We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 544d761 commit a978631Copy full SHA for a978631
plugins/gatsby-remark-japanese-fix/index.js
@@ -1,7 +1,7 @@
1
const toString = require('mdast-util-to-string');
2
const visit = require('unist-util-visit');
3
4
-const hasJapaneseCharacter = str => {
+const hasJapaneseCharacter = (str) => {
5
// Detects katakana, hiragana, iteration marks, and CJK unified ideographs
6
return /[\u30a0-\u30ff\u3040-\u309f\u3005-\u3006\u4e00-\u9fea。、]/.test(str);
7
};
@@ -13,7 +13,7 @@ const hasJapaneseCharacter = str => {
13
*/
14
15
module.exports = ({markdownAST}, options) => {
16
- visit(markdownAST, 'emphasis', node => {
+ visit(markdownAST, 'emphasis', (node) => {
17
const nodeStr = toString(node);
18
if (hasJapaneseCharacter(nodeStr)) {
19
// Patch AST
src/css/ja-fix.css
@@ -1,4 +1,4 @@
.em-ja {
font-weight: bolder;
font-style: normal;
-}
+}
0 commit comments