mirror of
https://github.com/facebook/docusaurus.git
synced 2025-07-30 15:00:09 +02:00
chore: add cSpell for spell checking (#6456)
* chore: Add cSpell for spell checking * chore: exclude map files and remove dups * chore: exclude more binary files * chore: remove MD headings * Update .cspell.json * fix a few spellings * fix more * fix Signed-off-by: Joshua Chen <sidachen2003@gmail.com> * fix a few * oops Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
This commit is contained in:
parent
a41a5c328c
commit
521eb119a7
64 changed files with 852 additions and 142 deletions
|
@ -38,9 +38,9 @@ export default function extractMetadata(content: string): Data {
|
|||
// New line characters => to handle all operating systems.
|
||||
const lines = (both.header ?? '').split(/\r?\n/);
|
||||
for (let i = 0; i < lines.length - 1; i += 1) {
|
||||
const keyvalue = lines[i].split(':');
|
||||
const key = keyvalue[0].trim();
|
||||
let value = keyvalue.slice(1).join(':').trim();
|
||||
const keyValue = lines[i].split(':');
|
||||
const key = keyValue[0].trim();
|
||||
let value = keyValue.slice(1).join(':').trim();
|
||||
try {
|
||||
value = JSON.parse(value);
|
||||
} catch (err) {
|
||||
|
@ -51,7 +51,7 @@ export default function extractMetadata(content: string): Data {
|
|||
return {metadata, rawContent: both.content};
|
||||
}
|
||||
|
||||
// The new frontmatter parser need some special chars to
|
||||
// The new front matter parser need some special chars to
|
||||
export function shouldQuotifyFrontMatter([key, value]: [
|
||||
string,
|
||||
string,
|
||||
|
@ -67,7 +67,7 @@ export function shouldQuotifyFrontMatter([key, value]: [
|
|||
return true;
|
||||
}
|
||||
// TODO this is not ideal to have to maintain such a list of allowed chars
|
||||
// maybe we should quotify if graymatter throws instead?
|
||||
// maybe we should quotify if gray-matter throws instead?
|
||||
return !String(value).match(
|
||||
/^([\w .\-sàáâãäåçèéêëìíîïðòóôõöùúûüýÿ!;,=+_?'`&#()[\]§%€$])+$/,
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue