use prism-tomorrow.css
This commit is contained in:
29
docs/_style/prism-master/tests/languages/jsx/issue1103.test
Normal file
29
docs/_style/prism-master/tests/languages/jsx/issue1103.test
Normal file
@ -0,0 +1,29 @@
|
||||
var myDivElement = <div foo="bar baz" />;
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "var"],
|
||||
" myDivElement ",
|
||||
["operator", "="],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"div"
|
||||
]],
|
||||
["attr-name", ["foo"]],
|
||||
["attr-value", [
|
||||
["punctuation", "="],
|
||||
["punctuation", "\""],
|
||||
"bar baz",
|
||||
["punctuation", "\""]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]],
|
||||
["punctuation", ";"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks that quoted attribute values can contain spaces.
|
||||
See #1103.
|
29
docs/_style/prism-master/tests/languages/jsx/issue1235.test
Normal file
29
docs/_style/prism-master/tests/languages/jsx/issue1235.test
Normal file
@ -0,0 +1,29 @@
|
||||
<Child options={{ track: true }}>
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "Child"]
|
||||
]],
|
||||
["attr-name", ["options"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "{"],
|
||||
" track",
|
||||
["punctuation", ":"],
|
||||
["boolean", "true"],
|
||||
["punctuation", "}"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks that attribute can contain an simple object.
|
||||
See #1235.
|
26
docs/_style/prism-master/tests/languages/jsx/issue1236.test
Normal file
26
docs/_style/prism-master/tests/languages/jsx/issue1236.test
Normal file
@ -0,0 +1,26 @@
|
||||
<Child {...this.props}>
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "Child"]
|
||||
]],
|
||||
["spread", [
|
||||
["punctuation", "{"],
|
||||
["punctuation", "..."],
|
||||
["attr-value", "this"],
|
||||
["punctuation", "."],
|
||||
["attr-value", "props"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks that spread can contain an object property.
|
||||
See #1236.
|
71
docs/_style/prism-master/tests/languages/jsx/issue1294.test
Normal file
71
docs/_style/prism-master/tests/languages/jsx/issue1294.test
Normal file
@ -0,0 +1,71 @@
|
||||
export default () => (
|
||||
<div>
|
||||
<h1>Hi! I'm building a fake Gatsby site as part of a tutorial!</h1>
|
||||
<p>
|
||||
What do I like to do? Lots of course but definitely enjoy building
|
||||
websites.
|
||||
</p>
|
||||
</div>
|
||||
);
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "export"],
|
||||
["keyword", "default"],
|
||||
["punctuation", "("],
|
||||
["punctuation", ")"],
|
||||
["operator", "=>"], ["punctuation", "("],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"div"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n\t\t"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"h1"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "Hi! I'm building a fake Gatsby site as part of a tutorial!"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"h1"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n\t\t"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"p"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n\t\t\tWhat do I like to do? Lots of course but definitely enjoy building\r\n\t\t\twebsites.\r\n\t\t"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"p"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n\t"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"div"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["punctuation", ")"], ["punctuation", ";"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
See #1294.
|
126
docs/_style/prism-master/tests/languages/jsx/issue1335.test
Normal file
126
docs/_style/prism-master/tests/languages/jsx/issue1335.test
Normal file
@ -0,0 +1,126 @@
|
||||
<Button onClick={(e) => this.setState({clicked: true})} />
|
||||
<Component
|
||||
data={[
|
||||
{id: 0, name: 'Joe'},
|
||||
{id: 1, name: 'Sue'},
|
||||
]}
|
||||
/>
|
||||
<Component title={`${name}`} />
|
||||
<Component title={`${name}'s page`} />
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "Button"]
|
||||
]],
|
||||
["attr-name", ["onClick"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "("],
|
||||
["parameter", [
|
||||
"e"
|
||||
]],
|
||||
["punctuation", ")"],
|
||||
["operator", "=>"],
|
||||
["keyword", "this"],
|
||||
["punctuation", "."],
|
||||
["function", "setState"],
|
||||
["punctuation", "("],
|
||||
["punctuation", "{"],
|
||||
"clicked",
|
||||
["punctuation", ":"],
|
||||
["boolean", "true"],
|
||||
["punctuation", "}"],
|
||||
["punctuation", ")"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "Component"]
|
||||
]],
|
||||
["attr-name", ["data"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "["],
|
||||
["punctuation", "{"],
|
||||
"id",
|
||||
["punctuation", ":"],
|
||||
["number", "0"],
|
||||
["punctuation", ","],
|
||||
" name",
|
||||
["punctuation", ":"],
|
||||
["string", "'Joe'"],
|
||||
["punctuation", "}"],
|
||||
["punctuation", ","],
|
||||
["punctuation", "{"],
|
||||
"id",
|
||||
["punctuation", ":"],
|
||||
["number", "1"],
|
||||
["punctuation", ","],
|
||||
" name",
|
||||
["punctuation", ":"],
|
||||
["string", "'Sue'"],
|
||||
["punctuation", "}"],
|
||||
["punctuation", ","],
|
||||
["punctuation", "]"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "Component"]
|
||||
]],
|
||||
["attr-name", ["title"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["template-string", [
|
||||
["string", "`"],
|
||||
["interpolation", [
|
||||
["interpolation-punctuation", "${"],
|
||||
"name",
|
||||
["interpolation-punctuation", "}"]
|
||||
]],
|
||||
["string", "`"]
|
||||
]],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "Component"]
|
||||
]],
|
||||
["attr-name", ["title"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["template-string", [
|
||||
["string", "`"],
|
||||
["interpolation", [
|
||||
["interpolation-punctuation", "${"],
|
||||
"name",
|
||||
["interpolation-punctuation", "}"]
|
||||
]],
|
||||
["string", "'s page`"]
|
||||
]],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Handles nested pairs of curly braces inside tag attribute. See #1335
|
53
docs/_style/prism-master/tests/languages/jsx/issue1342.test
Normal file
53
docs/_style/prism-master/tests/languages/jsx/issue1342.test
Normal file
@ -0,0 +1,53 @@
|
||||
<CodeView title={<span title={123}>2</span>}>for of as</CodeView>
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "CodeView"]
|
||||
]],
|
||||
["attr-name", ["title"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"span"
|
||||
]],
|
||||
["attr-name", ["title"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["number", "123"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "2"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"span"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "for of as"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
["class-name", "CodeView"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for nested tag with JSX inside another tag with JSX. See #1342
|
32
docs/_style/prism-master/tests/languages/jsx/issue1356.test
Normal file
32
docs/_style/prism-master/tests/languages/jsx/issue1356.test
Normal file
@ -0,0 +1,32 @@
|
||||
<a href="//localhost">link</a>
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"a"
|
||||
]],
|
||||
["attr-name", ["href"]],
|
||||
["attr-value", [
|
||||
["punctuation", "="],
|
||||
["punctuation", "\""],
|
||||
"//localhost",
|
||||
["punctuation", "\""]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "link"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"a"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for tags containing "//". See #1356.
|
25
docs/_style/prism-master/tests/languages/jsx/issue1364.test
Normal file
25
docs/_style/prism-master/tests/languages/jsx/issue1364.test
Normal file
@ -0,0 +1,25 @@
|
||||
<CodeView title={{}} />
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "CodeView"]
|
||||
]],
|
||||
["attr-name", ["title"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "}"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for empty objects in JSX. See #1364
|
36
docs/_style/prism-master/tests/languages/jsx/issue1408.test
Normal file
36
docs/_style/prism-master/tests/languages/jsx/issue1408.test
Normal file
@ -0,0 +1,36 @@
|
||||
<div style={{ marginLeft: `${sidePanelWidth}px` }}>
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"div"
|
||||
]],
|
||||
["attr-name", ["style"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["punctuation", "{"],
|
||||
" marginLeft",
|
||||
["punctuation", ":"],
|
||||
["template-string", [
|
||||
["string", "`"],
|
||||
["interpolation", [
|
||||
["interpolation-punctuation", "${"],
|
||||
"sidePanelWidth",
|
||||
["interpolation-punctuation", "}"]
|
||||
]],
|
||||
["string", "px`"]
|
||||
]],
|
||||
["punctuation", "}"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for template string with interpolation inside object inside JSX tag. See #1408
|
58
docs/_style/prism-master/tests/languages/jsx/issue1421.test
Normal file
58
docs/_style/prism-master/tests/languages/jsx/issue1421.test
Normal file
@ -0,0 +1,58 @@
|
||||
class Columns extends React.Component {
|
||||
render() {
|
||||
return (
|
||||
<>
|
||||
<td>Hello</td>
|
||||
<td>World</td>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "class"],
|
||||
["class-name", ["Columns"]],
|
||||
["keyword", "extends"],
|
||||
["class-name", ["React", ["punctuation", "."], "Component"]],
|
||||
["punctuation", "{"],
|
||||
["function", "render"],
|
||||
["punctuation", "("], ["punctuation", ")"],
|
||||
["punctuation", "{"],
|
||||
["keyword", "return"], ["punctuation", "("],
|
||||
["tag", [
|
||||
["tag", [["punctuation", "<"]]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n "],
|
||||
["tag", [
|
||||
["tag", [["punctuation", "<"], "td"]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "Hello"],
|
||||
["tag", [
|
||||
["tag", [["punctuation", "</"], "td"]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n "],
|
||||
["tag", [
|
||||
["tag", [["punctuation", "<"], "td"]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "World"],
|
||||
["tag", [
|
||||
["tag", [["punctuation", "</"], "td"]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n "],
|
||||
["tag", [
|
||||
["tag", [["punctuation", "</"]]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["punctuation", ")"], ["punctuation", ";"],
|
||||
["punctuation", "}"], ["punctuation", "}"]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
Checks for fragments short syntax. See #1421
|
@ -0,0 +1,57 @@
|
||||
<div>
|
||||
foobar for
|
||||
<div>
|
||||
foobar for
|
||||
</div>
|
||||
foobar for {i == 0 ? 42 : 0}}
|
||||
</div>
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"div"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n\tfoobar for\r\n\t"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"div"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n\t\tfoobar for\r\n\t"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"div"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", "\r\n\tfoobar for "],
|
||||
["punctuation", "{"],
|
||||
"i ",
|
||||
["operator", "=="],
|
||||
["number", "0"],
|
||||
["operator", "?"],
|
||||
["number", "42"],
|
||||
["punctuation", ":"],
|
||||
["number", "0"],
|
||||
["punctuation", "}"],
|
||||
["plain-text", "}\r\n"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"div"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks that plain text inside tags is unmatched.
|
@ -0,0 +1,83 @@
|
||||
var myDivElement = <div className="foo" />;
|
||||
var myElement = <MyComponent someProperty={true} />;
|
||||
<div {...foo}></div>
|
||||
<> </>
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
[
|
||||
["keyword", "var"],
|
||||
" myDivElement ",
|
||||
["operator", "="],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"div"
|
||||
]],
|
||||
["attr-name", ["className"]],
|
||||
["attr-value", [
|
||||
["punctuation", "="],
|
||||
["punctuation", "\""],
|
||||
"foo",
|
||||
["punctuation", "\""]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]],
|
||||
["punctuation", ";"],
|
||||
|
||||
["keyword", "var"],
|
||||
" myElement ",
|
||||
["operator", "="],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
["class-name", "MyComponent"]
|
||||
]],
|
||||
["attr-name", ["someProperty"]],
|
||||
["script", [
|
||||
["script-punctuation", "="],
|
||||
["punctuation", "{"],
|
||||
["boolean", "true"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", "/>"]
|
||||
]],
|
||||
["punctuation", ";"],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"],
|
||||
"div"
|
||||
]],
|
||||
["spread", [
|
||||
["punctuation", "{"],
|
||||
["punctuation", "..."],
|
||||
["attr-value", "foo"],
|
||||
["punctuation", "}"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"],
|
||||
"div"
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "<"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]],
|
||||
["plain-text", " "],
|
||||
["tag", [
|
||||
["tag", [
|
||||
["punctuation", "</"]
|
||||
]],
|
||||
["punctuation", ">"]
|
||||
]]
|
||||
]
|
||||
|
||||
----------------------------------------------------
|
||||
|
||||
Checks for JSX tags.
|
Reference in New Issue
Block a user