Skip to content

Commit

Permalink
Merge branch 'main' into add-reg
Browse files Browse the repository at this point in the history
  • Loading branch information
bokuweb authored Nov 1, 2024
2 parents 40fede4 + 55961d6 commit 9f186a9
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docx-core/src/documents/elements/based_on.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Serialize, Serializer};

use crate::documents::BuildXML;
use crate::escape::escape;
use crate::xml_builder::*;

#[derive(Debug, Clone, PartialEq)]
Expand All @@ -10,7 +11,9 @@ pub struct BasedOn {

impl BasedOn {
pub fn new(val: impl Into<String>) -> BasedOn {
BasedOn { val: val.into() }
BasedOn {
val: escape(&val.into()),
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion docx-core/src/documents/elements/link.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Serialize, Serializer};

use crate::documents::BuildXML;
use crate::escape::escape;
use crate::xml_builder::*;

#[derive(Debug, Clone, PartialEq)]
Expand All @@ -10,7 +11,9 @@ pub struct Link {

impl Link {
pub fn new(val: impl Into<String>) -> Link {
Link { val: val.into() }
Link {
val: escape(&val.into()),
}
}
}

Expand Down
5 changes: 4 additions & 1 deletion docx-core/src/documents/elements/paragraph_style.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Serialize, Serializer};

use crate::documents::BuildXML;
use crate::escape::escape;
use crate::xml_builder::*;

#[derive(Debug, Clone, PartialEq)]
Expand All @@ -25,7 +26,9 @@ impl Default for ParagraphStyle {
impl ParagraphStyle {
pub fn new(val: Option<impl Into<String>>) -> ParagraphStyle {
if let Some(v) = val {
ParagraphStyle { val: v.into() }
ParagraphStyle {
val: escape(&v.into()),
}
} else {
Default::default()
}
Expand Down
5 changes: 4 additions & 1 deletion docx-core/src/documents/elements/run_style.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::{Serialize, Serializer};

use crate::documents::BuildXML;
use crate::escape::escape;
use crate::xml_builder::*;

#[derive(Debug, Clone, PartialEq)]
Expand All @@ -18,7 +19,9 @@ impl Default for RunStyle {

impl RunStyle {
pub fn new(val: impl Into<String>) -> RunStyle {
RunStyle { val: val.into() }
RunStyle {
val: escape(&val.into()),
}
}
}

Expand Down
3 changes: 2 additions & 1 deletion docx-core/src/documents/elements/style.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use serde::Serialize;

use crate::documents::BuildXML;
use crate::escape::escape;
use crate::types::*;
use crate::xml_builder::*;
use crate::StyleType;
Expand Down Expand Up @@ -47,7 +48,7 @@ impl Style {
pub fn new(style_id: impl Into<String>, style_type: StyleType) -> Self {
let default = Default::default();
Style {
style_id: style_id.into(),
style_id: escape(&style_id.into()),
style_type,
..default
}
Expand Down
2 changes: 1 addition & 1 deletion docx-wasm/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "docx-wasm",
"version": "0.4.18-rc17",
"version": "0.4.18-rc18",
"main": "dist/node/index.js",
"browser": "dist/web/index.js",
"author": "bokuweb <bokuweb12@gmail.com>",
Expand Down

0 comments on commit 9f186a9

Please sign in to comment.