Skip to content

fix: handle complex HTML in DataviewJS output#109

Open
Huasushis wants to merge 4 commits intosaberzero1:mainfrom
Huasushis:fix/dataview-complex-html
Open

fix: handle complex HTML in DataviewJS output#109
Huasushis wants to merge 4 commits intosaberzero1:mainfrom
Huasushis:fix/dataview-complex-html

Conversation

@Huasushis
Copy link

Solve #108 and improve htmlToMarkdown effect

  • Wrap decodeURI in try/catch to prevent URIError on bare % characters (e.g. '进度:50%' in rendered table output)

  • Add whitelist-based isMarkdownSafeNode() to detect content that Markdown cannot faithfully represent (progress bars, styled spans, merged cells, inline styles, etc.)

  • Add convertRenderedContent() that processes each top-level child independently: markdown-safe children are converted normally, complex children are kept as raw HTML with internal links cleaned for Quartz consumption

  • Internal links in HTML output use tags (not [[wikilinks]]) so Quartz's CrawlLinks plugin can resolve them correctly

- Wrap decodeURI in try/catch to prevent URIError on bare % characters
  (e.g. '进度:50%' in rendered table output)

- Add whitelist-based isMarkdownSafeNode() to detect content that
  Markdown cannot faithfully represent (progress bars, styled spans,
  merged cells, inline styles, etc.)

- Add convertRenderedContent() that processes each top-level child
  independently: markdown-safe children are converted normally,
  complex children are kept as raw HTML with internal links cleaned
  for Quartz consumption

- Internal links in HTML output use <a> tags (not [[wikilinks]])
  so Quartz's CrawlLinks plugin can resolve them correctly
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant