Explorar o código

replace colon with dollar sign

Yuki Takei %!s(int64=3) %!d(string=hai) anos
pai
achega
32ff8a5921

+ 2 - 2
packages/app/src/services/renderer/renderer.ts

@@ -264,7 +264,7 @@ export const generateViewOptions = (
   // add remark plugins
   if (remarkPlugins != null) {
     remarkPlugins.push(emoji);
-    remarkPlugins.push(math);
+    // remarkPlugins.push(math);
     if (config.isEnabledLinebreaks) {
       remarkPlugins.push(breaks);
     }
@@ -272,7 +272,7 @@ export const generateViewOptions = (
 
   // store toc node
   if (rehypePlugins != null) {
-    rehypePlugins.push(katex);
+    // rehypePlugins.push(katex);
     rehypePlugins.push([toc, {
       nav: false,
       headings: ['h1', 'h2', 'h3'],

+ 5 - 5
packages/remark-growi-plugin/src/mdast-util-growi-plugin/index.js

@@ -83,12 +83,12 @@ export const directiveToMarkdown = {
       inConstruct: ['leafGrowiPluginDirectiveLabel', 'containerGrowiPluginDirectiveLabel'],
     },
     {
-      before: '[^:]',
-      character: ':',
+      before: '[^$]',
+      character: '$',
       after: '[A-Za-z]',
       inConstruct: ['phrasing'],
     },
-    { atBreak: true, character: ':', after: ':' },
+    { atBreak: true, character: '$', after: '$' },
   ],
   handlers: {
     containerGrowiPluginDirective: handleDirective,
@@ -274,7 +274,7 @@ function handleDirective(node, _, context, safeOptions) {
 
 /** @type {ToMarkdownHandle} */
 function peekDirective() {
-  return ':';
+  return '$';
 }
 
 /**
@@ -391,7 +391,7 @@ function fence(node) {
     size = 1;
   }
 
-  return ':'.repeat(size);
+  return '$'.repeat(size);
 
   /** @type {import('unist-util-visit-parents/complex-types').BuildVisitor<Root, Directive>} */
   function onvisit(_, parents) {

+ 3 - 3
packages/remark-growi-plugin/src/micromark-extension-growi-plugin/lib/directive-container.js

@@ -42,7 +42,7 @@ function tokenizeDirectiveContainer(effects, ok, nok) {
 
   /** @type {State} */
   function start(code) {
-    assert(code === codes.colon, 'expected `:`');
+    assert(code === codes.dollarSign, 'expected `$`');
     effects.enter('directiveContainer');
     effects.enter('directiveContainerFence');
     effects.enter('directiveContainerSequence');
@@ -51,7 +51,7 @@ function tokenizeDirectiveContainer(effects, ok, nok) {
 
   /** @type {State} */
   function sequenceOpen(code) {
-    if (code === codes.colon) {
+    if (code === codes.dollarSign) {
       effects.consume(code);
       sizeOpen++;
       return sequenceOpen;
@@ -214,7 +214,7 @@ function tokenizeDirectiveContainer(effects, ok, nok) {
 
     /** @type {State} */
     function closingSequence(code) {
-      if (code === codes.colon) {
+      if (code === codes.dollarSign) {
         effects.consume(code);
         size++;
         return closingSequence;

+ 2 - 2
packages/remark-growi-plugin/src/micromark-extension-growi-plugin/lib/directive-leaf.js

@@ -29,7 +29,7 @@ function tokenizeDirectiveLeaf(effects, ok, nok) {
 
   /** @type {State} */
   function start(code) {
-    assert(code === codes.colon, 'expected `:`');
+    assert(code === codes.dollarSign, 'expected `$`');
     effects.enter('directiveLeaf');
     effects.enter('directiveLeafSequence');
     effects.consume(code);
@@ -38,7 +38,7 @@ function tokenizeDirectiveLeaf(effects, ok, nok) {
 
   /** @type {State} */
   function inStart(code) {
-    if (code === codes.colon) {
+    if (code === codes.dollarSign) {
       effects.consume(code);
       effects.exit('directiveLeafSequence');
       return factoryName.call(

+ 3 - 3
packages/remark-growi-plugin/src/micromark-extension-growi-plugin/lib/directive-text.js

@@ -26,7 +26,7 @@ const attributes = { tokenize: tokenizeAttributes, partial: true };
 function previous(code) {
   // If there is a previous code, there will always be a tail.
   return (
-    code !== codes.colon
+    code !== codes.dollarSign
     || this.events[this.events.length - 1][1].type === types.characterEscape
   );
 }
@@ -40,7 +40,7 @@ function tokenizeDirectiveText(effects, ok, nok) {
 
   /** @type {State} */
   function start(code) {
-    assert(code === codes.colon, 'expected `:`');
+    assert(code === codes.dollarSign, 'expected `$`');
     assert(previous.call(self, self.previous), 'expected correct previous');
     effects.enter('directiveText');
     effects.enter('directiveTextMarker');
@@ -52,7 +52,7 @@ function tokenizeDirectiveText(effects, ok, nok) {
   /** @type {State} */
   function afterName(code) {
     // eslint-disable-next-line no-nested-ternary
-    return code === codes.colon
+    return code === codes.dollarSign
       ? nok(code)
       : code === codes.leftSquareBracket
         ? effects.attempt(label, afterLabel, afterLabel)(code)

+ 2 - 2
packages/remark-growi-plugin/src/micromark-extension-growi-plugin/lib/syntax.js

@@ -13,7 +13,7 @@ import { directiveText } from './directive-text.js';
  */
 export function directive() {
   return {
-    text: { [codes.colon]: directiveText },
-    flow: { [codes.colon]: [directiveContainer, directiveLeaf] },
+    text: { [codes.dollarSign]: directiveText },
+    flow: { [codes.dollarSign]: [directiveContainer, directiveLeaf] },
   };
 }