Skip to content

Commit

Permalink
✨ feat: highlight support html (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
rdmclin2 authored Mar 21, 2024
1 parent 5dd4ff7 commit faa9a74
Show file tree
Hide file tree
Showing 4 changed files with 594 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Highlight/demos/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,26 @@ const configs = [
text: 'Yaml',
code: '---\n# comment\nstring_1: "Bar"\nstring_2: \'bar\'\nstring_3: bar\ninline_keys_ignored: sompath/name/file.jpg\nkeywords_in_yaml:\n - true\n - false\n - TRUE\n - FALSE\n - 21\n - 21.0\n - !!str 123\n"quoted_key": &foobar\n bar: foo\n foo:\n "foo": bar\n\nreference: *foobar\n\nmultiline_1: |\n Multiline\n String\nmultiline_2: >\n Multiline\n String\nmultiline_3: "\n Multiline string\n "\n\nansible_variables: "foo {{variable}}"\n\narray_nested:\n- a\n- b: 1\n c: 2\n- b\n- comment',
},
{
language: 'html',
text: 'Html',
code: `<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Html Dom Render</title>
</head>
<body>
<div>Custom Html Dom Render</div>
<ul>
<li>Ant Desgin</li>
<li>Ant Desgin Pro</li>
<li>Ant Desgin Pro Components</li>
</ul>
</body>
</html>`,
},
];

export default configs;
1 change: 1 addition & 0 deletions src/Highlight/hooks/useHighlight.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export const languageMap = {
json,
markdown,
xml,
html: xml,
yaml,
tsx,
jsx,
Expand Down
19 changes: 19 additions & 0 deletions src/Markdown/demos/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,25 @@ This is [an example](http://example.com/ "Title") inline link.
$ pnpm install
\`\`\`
\`\`\`html
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Custom Html Dom Render</title>
</head>
<body>
<div>Custom Html Dom Render</div>
<ul>
<li>Ant Desgin</li>
<li>Ant Desgin Pro</li>
<li>Ant Desgin Pro Components</li>
</ul>
</body>
</html>
\`\`\`
\`\`\`javascript
import { renderHook } from '@testing-library/react-hooks';
Expand Down
Loading

0 comments on commit faa9a74

Please sign in to comment.