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

Strip HTML tags (but keep any text content) when rendering text #33

Merged
merged 16 commits into from Oct 2, 2021

Commits on Sep 12, 2021

  1. Configuration menu
    Copy the full SHA
    7834c27 View commit details
    Browse the repository at this point in the history
  2. Remove fmt.Println

    mntn-xyz committed Sep 12, 2021
    Configuration menu
    Copy the full SHA
    34cd4c6 View commit details
    Browse the repository at this point in the history

Commits on Sep 19, 2021

  1. Configuration menu
    Copy the full SHA
    5df2399 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    9e78c95 View commit details
    Browse the repository at this point in the history
  3. Render HTML block content

    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.
    mntn-xyz committed Sep 19, 2021
    Configuration menu
    Copy the full SHA
    b4a9bea View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    8fdc8c0 View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2021

  1. Configuration menu
    Copy the full SHA
    25aec5f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a13aa93 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2021

  1. 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.
    mntn-xyz committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    9b4b07c View commit details
    Browse the repository at this point in the history
  2. Fix hardbreak

    mntn-xyz committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    1f902d1 View commit details
    Browse the repository at this point in the history

Commits on Oct 1, 2021

  1. Merge from master

    mntn-xyz committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    6dc81d8 View commit details
    Browse the repository at this point in the history
  2. Add test for hard break

    mntn-xyz committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    280c969 View commit details
    Browse the repository at this point in the history
  3. Add more HTML tests

    mntn-xyz committed Oct 1, 2021
    Configuration menu
    Copy the full SHA
    53c388e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    1f6bb3a View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    443e1c5 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    247c5c7 View commit details
    Browse the repository at this point in the history