forked from mastodon/mastodon
-
Notifications
You must be signed in to change notification settings - Fork 184
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
Add syntax highlighting to code tags #2457
Open
Plastikmensch
wants to merge
6
commits into
glitch-soc:main
Choose a base branch
from
Plastikmensch:redo/add-syntax-highlighting-to-code-blocks
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add syntax highlighting to code tags #2457
Plastikmensch
wants to merge
6
commits into
glitch-soc:main
from
Plastikmensch:redo/add-syntax-highlighting-to-code-blocks
Commits on Nov 17, 2023
-
highlight.js will be used to do the highlighting in the web interface Signed-off-by: Plastikmensch <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for aa8e66a - Browse repository at this point
Copy the full SHA aa8e66aView commit details -
Imports necessary styles from highlight.js Github style has been chosen as a default, because it is what most people will be familiar with. Signed-off-by: Plastikmensch <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5d54afc - Browse repository at this point
Copy the full SHA 5d54afcView commit details -
Allow
data-codelang
attribute on code tagsAllows users to set the language on code tags, which was previously discarded. Also allows this attribute on incoming toots. Signed-off-by: Plastikmensch <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f275873 - Browse repository at this point
Copy the full SHA f275873View commit details -
Remove invalid
data-codelang
in backendAdds a new yml file containing all valid code languages which are supported by highlight.js This file has been created by a script as the list of supported languages is unreliable. This is not ideal, but highlight.js made it clear they won't add new languages natively. Instead additional language support is provided by third-party packages. If such a third-party package is installed, this file needs to be updated to support the new aliases. When an unsupported language is given, the `data-codelang` attribute is removed using a new transformer. Signed-off-by: Plastikmensch <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for a22c3c3 - Browse repository at this point
Copy the full SHA a22c3c3View commit details -
Add Syntax highlighting to web UI
Adds a new function to add syntax highlighting on `contentHtml` Also supports translated content. Signed-off-by: Plastikmensch <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 57a7a17 - Browse repository at this point
Copy the full SHA 57a7a17View commit details -
Add tests to make sure valid `code-lang` attributes are kept and invalid ones removed. Signed-off-by: Plastikmensch <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 5416d99 - Browse repository at this point
Copy the full SHA 5416d99View 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.