Skip to content

Commit

Permalink
feat: enable highlighting js tagged template literals and modern js s…
Browse files Browse the repository at this point in the history
…yntax
  • Loading branch information
thanhtran-ct authored and satya164 committed Oct 31, 2020
1 parent 3b8967c commit 3730487
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
21 changes: 21 additions & 0 deletions example/__fixtures__/markdown/2.Markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,27 @@ Here is an example of AppleScript:
beep
end tell

Here is another example with syntax highlighting for React JSX and Linaria:

```js
import { styled } from 'linaria/react';

// Create a styled component
const Title = styled.h1`
font-size: 24px;
font-weight: bold;
&.title {
text-transform: capitalize;
}
`;

function Heading() {
// Use the styled component
return <Title>This is a title</Title>;
}
```

A code block continues until it reaches a line that is not indented

(or the end of the article).
Expand Down
2 changes: 2 additions & 0 deletions src/utils/highlight.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ const aliases = {

refractor.register(require('refractor/lang/clike'));
refractor.register(require('refractor/lang/javascript'));
refractor.register(require('refractor/lang/js-extras'));
refractor.register(require('refractor/lang/js-templates'));
refractor.register(require('refractor/lang/typescript'));
refractor.register(require('refractor/lang/markup'));
refractor.register(require('refractor/lang/jsx'));
Expand Down

0 comments on commit 3730487

Please sign in to comment.