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 HTML preset not highlighting script tags #230

Merged
merged 1 commit into from
Nov 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/dry-icons-repeat.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"prism-react-renderer": patch
---

Fix html language preset by using markup instead.
12 changes: 8 additions & 4 deletions packages/demo/src/sample-code.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ const GroceryItem = new Proxy({}, {
@property (nonatomic, assign) float price;
@property (nonatomic, assign) NSInteger quantity;

- (instancetype) initWithName: (NSString *)name
price: (float)price
- (instancetype) initWithName: (NSString *)name
price: (float)price
quantity: (NSInteger)quantity;

@end

@implementation GroceryItem

- (instancetype) initWithName: (NSString *)name
price: (float)price
- (instancetype) initWithName: (NSString *)name
price: (float)price
quantity: (NSInteger)quantity {
self = [super init];
if (self) {
Expand All @@ -88,6 +88,10 @@ const GroceryItem = new Proxy({}, {
<head>
<meta charset="UTF-8" />
<title>Formidable</title>
<script>
const name = "Formidable";
console.log(name);
</script>
</head>
<body>
<div id="root"></div>
Expand Down
2 changes: 1 addition & 1 deletion packages/generate-prism-languages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { languages as prismLanguages } from "prismjs/components"
import uglify from "uglify-js"

export const languagesToBundle = <const>[
"markup",
"jsx",
"tsx",
"swift",
Expand All @@ -20,7 +21,6 @@ export const languagesToBundle = <const>[
"go",
"cpp",
"markdown",
"html",
"python",
]

Expand Down
Loading