-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
de4c69b
commit 021fabc
Showing
28 changed files
with
1,306 additions
and
286 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React from 'react' | ||
import ReactMarkdown from 'react-markdown' | ||
import { HighlightedText } from './HighlightedText' | ||
import ReactDOMServer from 'react-dom/server' | ||
import rehypeRaw from 'rehype-raw' | ||
import remarkGfm from 'remark-gfm' | ||
|
||
interface Props { | ||
children: string | ||
} | ||
|
||
export function CompileDescription (props: Props) { | ||
const descriptionWithHighlightedSymbols = <HighlightedText>{props.children}</HighlightedText> | ||
|
||
return ( | ||
<ReactMarkdown | ||
skipHtml | ||
rehypePlugins={[rehypeRaw]} | ||
remarkPlugins={[remarkGfm]} | ||
components={{ | ||
table: ({ node, ...props }) => <table className='table table-sm table-striped table-bordered' {...props} /> | ||
}} | ||
> | ||
{ReactDOMServer.renderToStaticMarkup(descriptionWithHighlightedSymbols)} | ||
</ReactMarkdown> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { data } from './data' | ||
|
||
const keywords = ['Dash', 'Fight', 'Charge', 'Shoot', 'Overwatch', 'Normal Move', 'Fall Back'] | ||
|
||
describe('faction data', () => { | ||
it('has all the keywords bold', () => { | ||
for (const factionData of data) { | ||
for (const ployData of factionData.strategicPloys) { | ||
for (const keyword of keywords) { | ||
if (ployData.description.includes(keyword)) { | ||
expect(ployData.description).toContain(`**${keyword}**`) | ||
} | ||
} | ||
} | ||
|
||
for (const ployData of factionData.tacticalPloys) { | ||
for (const keyword of keywords) { | ||
if (ployData.description.includes(keyword)) { | ||
expect(ployData.description).toContain(`**${keyword}**`) | ||
} | ||
} | ||
} | ||
|
||
// @ts-expect-error | ||
if (factionData.tacOps !== undefined) { | ||
// @ts-expect-error | ||
for (const opsData of factionData.tacOps) { | ||
for (const keyword of keywords) { | ||
if (opsData.description.includes(keyword) === true) { | ||
expect(opsData.description).toContain(`**${keyword}**`) | ||
} | ||
} | ||
} | ||
} | ||
} | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.