fix: escape hyperlink (#556)

* fix: escape hyperlink

* fix

* fix

* update
main
bokuweb 2022-10-31 15:27:34 +09:00 committed by GitHub
parent 59b527b7c6
commit 561da27ce3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

View File

@ -2,6 +2,7 @@ use serde::Serialize;
use super::*; use super::*;
use crate::documents::BuildXML; use crate::documents::BuildXML;
use crate::escape::escape;
use crate::types::*; use crate::types::*;
use crate::{create_hyperlink_rid, generate_hyperlink_id, xml_builder::*}; use crate::{create_hyperlink_rid, generate_hyperlink_id, xml_builder::*};
@ -35,7 +36,7 @@ impl Hyperlink {
match t { match t {
HyperlinkType::External => HyperlinkData::External { HyperlinkType::External => HyperlinkData::External {
rid: create_hyperlink_rid(generate_hyperlink_id()), rid: create_hyperlink_rid(generate_hyperlink_id()),
path: value.into(), path: escape(&value.into()),
}, },
HyperlinkType::Anchor => HyperlinkData::Anchor { HyperlinkType::Anchor => HyperlinkData::Anchor {
anchor: value.into(), anchor: value.into(),

View File

@ -1,6 +1,6 @@
{ {
"name": "docx-wasm", "name": "docx-wasm",
"version": "0.0.276-rc28", "version": "0.0.276-rc29",
"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>",

4
yarn.lock 100644
View File

@ -0,0 +1,4 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1