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

HTTP: Improved content highlighting #1598

Merged
merged 2 commits into from
Dec 1, 2018
Merged

Conversation

RunDevelopment
Copy link
Member

This PR extends the content highlighting capabilities of HTTP.

  1. Addes support for application/javascript and text/css content types.
  2. Changed the languages associated with certain types:
    1. application/json now uses json with javascript as a backup instead of just javascript.
    2. All XML types now use Prism.languages.xml instead of markup.
    3. The HTML type now uses html instead of markup.
  3. Added support for highlighting based on suffixes for XML and JSON.
    E.g. image/svg+xml, application/xhtml+xml, application/atom+xml will use xml and application/calendar+json will use json.
  4. Stylistic changes:
    1. Fixed indentation.
    2. Used single quotes for token names.

@mAAdhaTTah
Copy link
Member

Based on the tests, I like this change. I'll have to dig through the regexes to give this a full review.

@mAAdhaTTah mAAdhaTTah merged commit 1b75da9 into PrismJS:master Dec 1, 2018
ggrossetie pushed a commit to ggrossetie/prism that referenced this pull request Mar 11, 2019
Extends the content highlighting capabilities of HTTP.

1. Add support for `application/javascript` and `text/css` content types.
2. Change the languages associated with certain types:
    1. `application/json` now uses `json` with `javascript` as a backup instead of just `javascript`.
    2. All XML types now use `Prism.languages.xml` instead of `markup`.
    3. The HTML type now uses `html` instead of `markup`.
3. Add support for highlighting based on [suffixes](https://en.wikipedia.org/wiki/Media_type#Suffix) for XML and JSON.
    E.g. `image/svg+xml`, `application/xhtml+xml`, `application/atom+xml` will use `xml` and `application/calendar+json` will use `json`.
4. Stylistic changes:
    1. Fix indentation.
    2. Use single quotes for token names.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants