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
Strip HTML tags (but keep any text content) when rendering text #33
Merged
Commits on Sep 12, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 7834c27 - Browse repository at this point
Copy the full SHA 7834c27View commit details -
Configuration menu - View commit details
-
Copy full SHA for 34cd4c6 - Browse repository at this point
Copy the full SHA 34cd4c6View commit details
Commits on Sep 19, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 5df2399 - Browse repository at this point
Copy the full SHA 5df2399View commit details -
Configuration menu - View commit details
-
Copy full SHA for 9e78c95 - Browse repository at this point
Copy the full SHA 9e78c95View commit details -
This also solves the issue of disappearing block content from top-level HTML blocks. Apparently gomarkdown does not provide a content-only attribute for HTML blocks; this is only for spans. I think we could just strip out the tags from the block content using https://github.com/grokify/html-strip-tags-go; the issue of untrusted data is not important since clients should not be rendering HTML tags or JavaScript for gemtext! bluemonday could be used if additional sanitization is desired, but this is a heavier solution.
Configuration menu - View commit details
-
Copy full SHA for b4a9bea - Browse repository at this point
Copy the full SHA b4a9beaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 8fdc8c0 - Browse repository at this point
Copy the full SHA 8fdc8c0View commit details
Commits on Sep 20, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 25aec5f - Browse repository at this point
Copy the full SHA 25aec5fView commit details -
Configuration menu - View commit details
-
Copy full SHA for a13aa93 - Browse repository at this point
Copy the full SHA a13aa93View commit details
Commits on Sep 22, 2021
-
Improve handling of HTMLBlock vs HTMLSpan
This corrects the issues with HTMLBlock and HTMLSpan parsing, adds a couple of features, and cleans up the code a bit. For HTMLBlock only, <br> is now interpreted as a hard line break. This should present the content more closely to how it was originaly intended. This has not been implemented for HTMLSpan because it could cause issues with blockquotes, so this is reserved for another time. For HTMLBlock only, the contents of several tags (script, iframe, etc) are stripped completely and will not be rendered. This can't be done as easily in HTMLSpan because the HTMLSpan only includes the tag itself, not the contents. It might be worth revisiting this later, although it's unlikely that many people will be including these tags inside of (for example) blockquotes or paragraphs.
Configuration menu - View commit details
-
Copy full SHA for 9b4b07c - Browse repository at this point
Copy the full SHA 9b4b07cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f902d1 - Browse repository at this point
Copy the full SHA 1f902d1View commit details
Commits on Oct 1, 2021
-
Configuration menu - View commit details
-
Copy full SHA for 6dc81d8 - Browse repository at this point
Copy the full SHA 6dc81d8View commit details -
Configuration menu - View commit details
-
Copy full SHA for 280c969 - Browse repository at this point
Copy the full SHA 280c969View commit details -
Configuration menu - View commit details
-
Copy full SHA for 53c388e - Browse repository at this point
Copy the full SHA 53c388eView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1f6bb3a - Browse repository at this point
Copy the full SHA 1f6bb3aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 443e1c5 - Browse repository at this point
Copy the full SHA 443e1c5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 247c5c7 - Browse repository at this point
Copy the full SHA 247c5c7View commit details
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.