forked from github/docs
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a test for non-English rendering (github#17593)
* Throw in some code that should fail a test * Remove read-frontmatter behavior * Unskip the test that would catch this * Remove the throw to pass the test
- Loading branch information
Showing
5 changed files
with
23 additions
and
66 deletions.
There are no files selected for viewing
File renamed without changes.
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,19 @@ | ||
const fs = require('fs') | ||
const encodeBracketedParentheses = require('./encode-bracketed-parentheses') | ||
const fm = require('./frontmatter') | ||
|
||
/** | ||
* Read only the frontmatter from file | ||
*/ | ||
module.exports = async function fmfromf (filepath, languageCode) { | ||
let fileContent = await fs.promises.readFile(filepath, 'utf8') | ||
|
||
fileContent = encodeBracketedParentheses(fileContent) | ||
|
||
// TODO remove this when crowdin-support issue 66 has been resolved | ||
if (languageCode !== 'en' && fileContent.includes(': verdadero')) { | ||
fileContent = fileContent.replace(': verdadero', ': true') | ||
} | ||
|
||
return fm(fileContent, { filepath }) | ||
} |
This file was deleted.
Oops, something went wrong.
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