Skip to content

Commit

Permalink
Update parser
Browse files Browse the repository at this point in the history
  • Loading branch information
Skalakid committed Aug 30, 2024
1 parent 1992975 commit 8f526b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion parser/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ function parseTreeToTextAndRanges(tree: StackItem): [string, Range[]] {
const hasAlt = node.tag.match(/data-link-variant="([^"]*)"/)![1] === 'labeled';
const rawLink = node.tag.match(/data-raw-href="([^"]*)"/);
const linkString = rawLink ? unescapeText(rawLink[1]!) : src;
ranges.push({type: 'inline-image', start: text.length, length: `!${hasAlt ? `[${alt?.[1] || ''}]` : ''}(${linkString})`.length});
ranges.push({type: 'inline-image', start: text.length, length: 3 + (alt?.[1] ? (alt?.[1].length || 0) + 2 : 0) + linkString.length});
appendSyntax('!');
if (hasAlt) {
appendSyntax('[');
Expand Down
4 changes: 2 additions & 2 deletions parser/react-native-live-markdown-parser.js

Large diffs are not rendered by default.

0 comments on commit 8f526b0

Please sign in to comment.