parent
4c7bd61ce9
commit
55961d6f9f
|
@ -1,6 +1,7 @@
|
||||||
use serde::{Serialize, Serializer};
|
use serde::{Serialize, Serializer};
|
||||||
|
|
||||||
use crate::documents::BuildXML;
|
use crate::documents::BuildXML;
|
||||||
|
use crate::escape::escape;
|
||||||
use crate::xml_builder::*;
|
use crate::xml_builder::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
@ -10,7 +11,9 @@ pub struct BasedOn {
|
||||||
|
|
||||||
impl BasedOn {
|
impl BasedOn {
|
||||||
pub fn new(val: impl Into<String>) -> BasedOn {
|
pub fn new(val: impl Into<String>) -> BasedOn {
|
||||||
BasedOn { val: val.into() }
|
BasedOn {
|
||||||
|
val: escape(&val.into()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use serde::{Serialize, Serializer};
|
use serde::{Serialize, Serializer};
|
||||||
|
|
||||||
use crate::documents::BuildXML;
|
use crate::documents::BuildXML;
|
||||||
|
use crate::escape::escape;
|
||||||
use crate::xml_builder::*;
|
use crate::xml_builder::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
@ -10,7 +11,9 @@ pub struct Link {
|
||||||
|
|
||||||
impl Link {
|
impl Link {
|
||||||
pub fn new(val: impl Into<String>) -> Link {
|
pub fn new(val: impl Into<String>) -> Link {
|
||||||
Link { val: val.into() }
|
Link {
|
||||||
|
val: escape(&val.into()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use serde::{Serialize, Serializer};
|
use serde::{Serialize, Serializer};
|
||||||
|
|
||||||
use crate::documents::BuildXML;
|
use crate::documents::BuildXML;
|
||||||
|
use crate::escape::escape;
|
||||||
use crate::xml_builder::*;
|
use crate::xml_builder::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
@ -25,7 +26,9 @@ impl Default for ParagraphStyle {
|
||||||
impl ParagraphStyle {
|
impl ParagraphStyle {
|
||||||
pub fn new(val: Option<impl Into<String>>) -> ParagraphStyle {
|
pub fn new(val: Option<impl Into<String>>) -> ParagraphStyle {
|
||||||
if let Some(v) = val {
|
if let Some(v) = val {
|
||||||
ParagraphStyle { val: v.into() }
|
ParagraphStyle {
|
||||||
|
val: escape(&v.into()),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
Default::default()
|
Default::default()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use serde::{Serialize, Serializer};
|
use serde::{Serialize, Serializer};
|
||||||
|
|
||||||
use crate::documents::BuildXML;
|
use crate::documents::BuildXML;
|
||||||
|
use crate::escape::escape;
|
||||||
use crate::xml_builder::*;
|
use crate::xml_builder::*;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq)]
|
#[derive(Debug, Clone, PartialEq)]
|
||||||
|
@ -18,7 +19,9 @@ impl Default for RunStyle {
|
||||||
|
|
||||||
impl RunStyle {
|
impl RunStyle {
|
||||||
pub fn new(val: impl Into<String>) -> RunStyle {
|
pub fn new(val: impl Into<String>) -> RunStyle {
|
||||||
RunStyle { val: val.into() }
|
RunStyle {
|
||||||
|
val: escape(&val.into()),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
use serde::Serialize;
|
use serde::Serialize;
|
||||||
|
|
||||||
use crate::documents::BuildXML;
|
use crate::documents::BuildXML;
|
||||||
|
use crate::escape::escape;
|
||||||
use crate::types::*;
|
use crate::types::*;
|
||||||
use crate::xml_builder::*;
|
use crate::xml_builder::*;
|
||||||
use crate::StyleType;
|
use crate::StyleType;
|
||||||
|
@ -47,7 +48,7 @@ impl Style {
|
||||||
pub fn new(style_id: impl Into<String>, style_type: StyleType) -> Self {
|
pub fn new(style_id: impl Into<String>, style_type: StyleType) -> Self {
|
||||||
let default = Default::default();
|
let default = Default::default();
|
||||||
Style {
|
Style {
|
||||||
style_id: style_id.into(),
|
style_id: escape(&style_id.into()),
|
||||||
style_type,
|
style_type,
|
||||||
..default
|
..default
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "docx-wasm",
|
"name": "docx-wasm",
|
||||||
"version": "0.4.18-rc16",
|
"version": "0.4.18-rc18",
|
||||||
"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>",
|
||||||
|
|
Loading…
Reference in New Issue