Skip to content

Inline markdown #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
21 changes: 21 additions & 0 deletions examples/markdown.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions examples/markdown.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<svg>
<rect wh="50 10" md="**Hello** _Markdown_ `world`!"/>
<rect xy="^|h" wh="10 50" text="***Hi* vertical** _Markdown\nwords_ `\ ***literal*** \`!" class="d-markdown d-text-vertical"/>
</svg>
2 changes: 1 addition & 1 deletion src/elements/element.rs
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ impl SvgElement {
// TODO: refactor this method to handle text event gen better
let phantom = matches!(self.name(), "point" | "box");

if self.has_attr("text") {
if self.has_attr("text") || self.has_attr("md") {
let (orig_elem, text_elements) = process_text_attr(self)?;

if orig_elem.name != "text" && !phantom {
Expand Down
Loading