Replies: 4 comments
-
output : |
Beta Was this translation helpful? Give feedback.
-
Indeed, alt text is considered a text node nested inside an image in CommonMark; see the AST output from the interactive dingus: <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE document SYSTEM "CommonMark.dtd">
<document xmlns="http://commonmark.org/xml/1.0">
<heading level="1">
<text>Awesome README </text>
<link destination="https://github.com/sindresorhus/awesome#readme" title="">
<image destination="https://cdn.jsdelivr.net/gh/sindresorhus/awesome@d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" title="">
<text>Awesome</text>
</image>
</link>
</heading>
</document> See also the Images part of the spec. If you don't want to consider it in your iterator, you'll need to note when you're nested inside an image and not process if so. |
Beta Was this translation helpful? Give feedback.
-
@kivikakk Thanks for the answer! Thanks in advance! |
Beta Was this translation helpful? Give feedback.
-
Seeing as this isn't an issue with Comrak itself, I'm going to convert this to a discussion. I don't have the time right now to write this up, as it's more of a general programming question, but I may later (or somebody else might be able to step in and help). |
Beta Was this translation helpful? Give feedback.
-
HI .
converted the following md file
# Awesome README [![Awesome](https://cdn.jsdelivr.net/gh/sindresorhus/awesome@d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg)](https://github.com/sindresorhus/awesome#readme)
Created node iter on type nodevalue::Text. while debuging i saw the alt="text" is considered text. is there a way to discard it ??
Thanks in advance,
dev0guy
Beta Was this translation helpful? Give feedback.
All reactions