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

✨ feat: highlight support html #173

Merged
merged 2 commits into from
Mar 21, 2024
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
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
Loading