Escape author (#646)

* fix: escape ins/del author

* fix
main
bokuweb 2023-08-15 15:44:10 +09:00 committed by GitHub
parent 296ca1135a
commit 73488ef2d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -1,8 +1,8 @@
use serde::ser::{SerializeStruct, Serializer}; use serde::ser::{SerializeStruct, Serializer};
use serde::Serialize; use serde::Serialize;
use crate::documents::*;
use crate::xml_builder::*; use crate::xml_builder::*;
use crate::{documents::*, escape};
#[derive(Serialize, Debug, Clone, PartialEq)] #[derive(Serialize, Debug, Clone, PartialEq)]
pub struct Delete { pub struct Delete {
@ -84,7 +84,7 @@ impl Delete {
} }
pub fn author(mut self, author: impl Into<String>) -> Delete { pub fn author(mut self, author: impl Into<String>) -> Delete {
self.author = author.into(); self.author = escape::escape(&author.into());
self self
} }

View File

@ -4,7 +4,7 @@ use serde::Serialize;
use super::*; use super::*;
use crate::documents::{BuildXML, HistoryId, Run}; use crate::documents::{BuildXML, HistoryId, Run};
use crate::xml_builder::*; use crate::{escape, xml_builder::*};
#[derive(Debug, Clone, PartialEq)] #[derive(Debug, Clone, PartialEq)]
pub enum InsertChild { pub enum InsertChild {
@ -127,7 +127,7 @@ impl Insert {
} }
pub fn author(mut self, author: impl Into<String>) -> Insert { pub fn author(mut self, author: impl Into<String>) -> Insert {
self.author = author.into(); self.author = escape::escape(&author.into());
self self
} }

View File

@ -1,6 +1,6 @@
{ {
"name": "docx-wasm", "name": "docx-wasm",
"version": "0.0.278-rc19", "version": "0.0.278-rc20",
"main": "dist/node/index.js", "main": "dist/node/index.js",
"browser": "dist/web/index.js", "browser": "dist/web/index.js",
"author": "bokuweb <bokuweb12@gmail.com>", "author": "bokuweb <bokuweb12@gmail.com>",