diff --git a/README.md b/README.md
index 5e636d1..ef55537 100644
--- a/README.md
+++ b/README.md
@@ -10,8 +10,8 @@ where their state, file effects, and cancellation can be verified.
The [product goal](docs/NATIVE_PRODUCT_GOAL.md) defines compatibility and live
preview acceptance. The [publisher matrix](docs/PUBLISHER_TEMPLATE_MATRIX.md)
covers original journals, two-column journals, conferences, and arXiv.
-The [local beta milestone](docs/NATIVE_PRODUCT_GOAL.md#beta-优先交付) describes
-the first supported projects and the edit, preview, and export workflow.
+The [local beta guide](docs/NATIVE_BETA.md) explains how to prepare a bundle,
+open a project in the native editor, and export a PDF.
## Native execution bootstrap
diff --git a/crates/texrra-tex-core/src/render.rs b/crates/texrra-tex-core/src/render.rs
index 6f5c7e0..195289b 100755
--- a/crates/texrra-tex-core/src/render.rs
+++ b/crates/texrra-tex-core/src/render.rs
@@ -625,7 +625,7 @@ impl DisplayList {
write!(
out,
"\n",
- face.name(), escape(&character.to_string()), face.0,
+ escape_attribute(face.name()), escape_attribute(&character.to_string()), face.0,
fill[0], fill[1], fill[2], escape(&character.to_string())
));
}
@@ -1083,6 +1083,15 @@ fn base64(data: &[u8]) -> String {
out
}
+fn escape_attribute(text: &str) -> String {
+ let escaped = escape(text);
+ if text.contains('"') {
+ escaped.replace('"', """)
+ } else {
+ escaped
+ }
+}
+
fn escape(text: &str) -> String {
text.replace('&', "&")
.replace('<', "<")
diff --git a/crates/texrra-tex-core/tests/math_native.rs b/crates/texrra-tex-core/tests/math_native.rs
index 2b19da3..7ebf2ed 100644
--- a/crates/texrra-tex-core/tests/math_native.rs
+++ b/crates/texrra-tex-core/tests/math_native.rs
@@ -6,11 +6,31 @@ use texrra_tex_core::math::{MathAtom, parse_math};
use texrra_tex_core::math_font::MathFontId;
use texrra_tex_core::paragraph::{HorizontalItem, InlineSegment, ParagraphFont, ParagraphStyle};
use texrra_tex_core::pdf::{PageOrigin, display_lists_to_pdf_with_cm_type1};
-use texrra_tex_core::render::DisplayItem;
+use texrra_tex_core::render::{DisplayItem, DisplayList};
use texrra_tex_core::{Document, Engine, Unit, VerticalItem};
const PT: i64 = 65_536;
+#[test]
+fn svg_glyph_labels_escape_attribute_quotes() {
+ let display = DisplayList {
+ width: 12 * PT,
+ height: 12 * PT,
+ items: vec![DisplayItem::MathGlyph {
+ x: 0,
+ y: 6 * PT,
+ size: 10 * PT,
+ character: '"',
+ face: MathFontId(0),
+ slot: b'"',
+ }],
+ ..DisplayList::default()
+ };
+ let svg = display.try_to_svg().unwrap();
+ assert!(svg.contains(r#"aria-label=""">