Skip to content
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

Render markdown before finding hash content #1433

Merged
merged 1 commit into from
Dec 30, 2020

Conversation

ang-zeyu
Copy link
Contributor

What is the purpose of this pull request?

  • Documentation update
  • Bug fix
  • Feature addition or enhancement
  • Code maintenance
  • Others, please explain:

Follow up to #1403, fixing one more instance where html is processed before markdown

Also fixes not being able to <include src="xx#hash" /> is #hash was defined using markdown-it-attributes (e.g. **segment**{id="hash"})

Overview of changes:
For <include>s with hashes, shift the markdown rendering from post-hash-search to pre-hash-search.

Anything you'd like to highlight / discuss:

  • Some corrections had to be made to non commonmark compliant markdown in the docs with this change
  • Some <p> elements are unwrapped in the expected test sites; These occur because we are now retrieving the hash-content post-markdown-rendering of the included source file

Testing instructions:
na


Checklist: ☑️

  • Updated the documentation for feature additions and enhancements
  • Added tests for bug fixes or features
  • Linked all related issues
  • No blatantly unrelated changes
  • Pinged someone for a review!

<include> elements referencing a specific #hash of a source file search
for the hash before rendering the file's markdown.

This prevents including elements with ids defined using
markdown-it-attributes, and necessitates markdown-html patches.

Let's process the included source file's markdown first, then search
for the hash.
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