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

fix: register hljs plaintext language #2103

Merged
merged 3 commits into from
May 14, 2024

Conversation

alexiscolin
Copy link
Member

@alexiscolin alexiscolin commented May 14, 2024

This PR aims to fix the md rendering issue when plaintext is summon by marked.js / hljs. It just registers the plaintext module into hljs js lib.

Fixes: #2084

@github-actions github-actions bot added the 📦 ⛰️ gno.land Issues or PRs gno.land package related label May 14, 2024
@alexiscolin alexiscolin requested a review from leohhhn May 14, 2024 15:06
Copy link

codecov bot commented May 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 47.02%. Comparing base (f6e7dcc) to head (d7ceced).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #2103   +/-   ##
=======================================
  Coverage   47.02%   47.02%           
=======================================
  Files         578      578           
  Lines       77571    77571           
=======================================
  Hits        36477    36477           
  Misses      38059    38059           
  Partials     3035     3035           
Flag Coverage Δ
gno.land 61.68% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this new highlight file come from?

it doesn't seem to match what I get when using the download page with go and plaintext...

@alexiscolin
Copy link
Member Author

alexiscolin commented May 14, 2024

@thehowl (and json), I customized it myself but do you prefer this one? :)

@thehowl
Copy link
Member

thehowl commented May 14, 2024

I don't have strong preferences either way BTW; it's just that minified code is never nice to review, and as a matter of principle, I think minified code should be either:

  1. generated from un-minified versions (and perhaps, have the minified version gitignore'd)
  2. easily retrievable from a common, trusted source (like in this case)

otherwise, we're vulnerable to an attack by injecting malicious code into minified code (which we don't review as accurately). Not saying you are, but it is a matter of principle

Copy link
Member

@thehowl thehowl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

matches what I'd expect, LGTM

@alexiscolin
Copy link
Member Author

alexiscolin commented May 14, 2024

@thehowl I agree, I would love to have/bring some basic front-end tasks pipelining to minify styles and scripts (automatically on CI for example). Now it's a real burden to work on it (and to test it)... Maybe something we could discuss about while we revamp gnoweb UX and front next weeks?

@thehowl thehowl merged commit 705cae9 into gnolang:master May 14, 2024
6 of 7 checks passed
jefft0 pushed a commit to jefft0/gno that referenced this pull request May 15, 2024
<!-- please provide a detailed description of the changes made in this
pull request. -->

This PR aims to fix the `md` rendering issue when `plaintext` is summon
by marked.js / hljs. It just registers the `plaintext` module into
`hljs` js lib.

Fixes: gnolang#2084
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📦 ⛰️ gno.land Issues or PRs gno.land package related
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[gnoweb] Text not rendered properly
2 participants