Skip to content

Commit 1487abf

Browse files
Merge pull request #5 from codedstructure/inline_markdown
Inline markdown
2 parents 37004c9 + 06bbb41 commit 1487abf

7 files changed

Lines changed: 969 additions & 38 deletions

File tree

examples/markdown.svg

Lines changed: 21 additions & 0 deletions
Loading

examples/markdown.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<svg>
2+
<rect wh="50 10" md="**Hello** _Markdown_ `world`!"/>
3+
<rect xy="^|h" wh="10 50" text="***Hi* vertical** _Markdown\nwords_ `\ ***literal*** \`!" class="d-markdown d-text-vertical"/>
4+
</svg>

src/elements/element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -437,7 +437,7 @@ impl SvgElement {
437437
// TODO: refactor this method to handle text event gen better
438438
let phantom = matches!(self.name(), "point" | "box");
439439

440-
if self.has_attr("text") {
440+
if self.has_attr("text") || self.has_attr("md") {
441441
let (orig_elem, text_elements) = process_text_attr(self, ctx)?;
442442

443443
if orig_elem.name != "text" && !phantom {

0 commit comments

Comments
 (0)