Render AsciiDoc package READMEs on the Info tab - #616
Open
AMDphreak wants to merge 1 commit into
Open
Conversation
Detect README.adoc/.asciidoc, convert with asciidoctor-d in secure fragment mode, and keep Markdown behavior for README.md. Co-authored-by: Cursor <cursoragent@cursor.com>
0xEAB
suggested changes
Jul 19, 2026
| dependency "dub" version="~>1.33" | ||
| dependency "userman" version="~>0.4.0" | ||
| dependency "uritemplate" version="~>1.0.0" | ||
| dependency "asciidoctor-d" version="~feature/html5-fragment-safe" repository="git+https://github.com/dlang-supplemental/asciidoctor-d.git" |
Member
There was a problem hiding this comment.
This dependency should probably get registered at code.dlang.org.
More importantly, DUB’s selections file has not been updated to reflect this change.
Comment on lines
+212
to
+213
| static dangerous = ctRegex!( | ||
| `(?is)<\s*(script|style|iframe|object|embed|link|meta|form|input|button|textarea|select)(\s[^>]*)?>.*?<\s*/\s*\1\s*>|<\s*(script|style|iframe|object|embed|link|meta|form|input|button|textarea|select)(\s[^>]*)?/?>`); |
Member
There was a problem hiding this comment.
I’m not keen on such a block-list approach.
Also, wasn’t it general wisdom to never use regex for parsing XML or HTML? Has this changed?
| @@ -0,0 +1,83 @@ | |||
| /* Lightweight AsciiDoc fragment styles for the package Info tab */ | |||
Member
There was a problem hiding this comment.
Why do they need their own distinct styling? Should they rather be styled in tandem with markdown documents?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
README.md, thenREADME.adoc/README.asciidoc, then bareREADME, then otherREADME*files.readmeFormat/readmeFileand render AsciiDoc via asciidoctor-d (secure HTML fragment).readmeFormat.Depends on fragment/secure support in asciidoctor-d (
feature/html5-fragment-safe). Until that lands on a tagged release,dub.sdlpoints at that branch.Test plan
README.adocshows formatted Info tab (headings, lists, code)README.mdunchangedjavascript:links are neutralizedMade with Cursor