فهرست منبع

Merge branch 'master' into fix/115285-116132-editor-not-resetting-when-same-markdown

Futa Arai 2 سال پیش
والد
کامیت
403b814469

+ 1 - 1
apps/app/resource/locales/en_US/sandbox.md

@@ -401,7 +401,7 @@ Content Cell,Content Cell
 
 # :memo: Footnote
 
-You can write a reference [^1] to a footnote. You can also add an inline footnote^[Inline_footnote].
+You can write a reference [^1] to a footnote.
 
 Long footnotes can be written as [^longnote].
 

+ 1 - 1
apps/app/resource/locales/ja_JP/sandbox.md

@@ -400,7 +400,7 @@ Content Cell,Content Cell
 
 # :memo: Footnote
 
-脚注への参照[^1]を書くことができます。また、インラインの脚注^[インラインで記述できる脚注です]を入れる事も出来ます。
+脚注への参照[^1]を書くことができます。
 
 長い脚注は[^longnote]のように書くことができます。
 

+ 1 - 1
apps/app/resource/locales/zh_CN/sandbox.md

@@ -401,7 +401,7 @@ Content Cell,Content Cell
 
 # :memo: Footnote
 
-You can write a reference [^1] to a footnote. You can also add an inline footnote^[Inline_footnote].
+You can write a reference [^1] to a footnote.
 
 Long footnotes can be written as [^longnote].
 

+ 5 - 4
apps/app/src/components/ReactMarkdownComponents/NextLink.tsx

@@ -28,13 +28,14 @@ const isAttached = (href: string): boolean => {
 
 type Props = Omit<LinkProps, 'href'> & {
   children: React.ReactNode,
+  id?: string,
   href?: string,
   className?: string,
 };
 
 export const NextLink = (props: Props): JSX.Element => {
   const {
-    href, children, className, ...rest
+    id, href, children, className, ...rest
   } = props;
 
   const { data: siteUrl } = useSiteUrl();
@@ -51,13 +52,13 @@ export const NextLink = (props: Props): JSX.Element => {
   // when href is an anchor link
   if (isAnchorLink(href)) {
     return (
-      <a href={href} className={className} {...dataAttributes}>{children}</a>
+      <a id={id} href={href} className={className} {...dataAttributes}>{children}</a>
     );
   }
 
   if (isExternalLink(href, siteUrl)) {
     return (
-      <a href={href} className={className} target="_blank" rel="noopener noreferrer" {...dataAttributes}>
+      <a id={id} href={href} className={className} target="_blank" rel="noopener noreferrer" {...dataAttributes}>
         {children}&nbsp;<i className='icon-share-alt small'></i>
       </a>
     );
@@ -68,7 +69,7 @@ export const NextLink = (props: Props): JSX.Element => {
     const dlhref = href.replace('/attachment/', '/download/');
     return (
       <span>
-        <a href={href} className={className} target="_blank" rel="noopener noreferrer" {...dataAttributes}>
+        <a id={id} href={href} className={className} target="_blank" rel="noopener noreferrer" {...dataAttributes}>
           {children}
         </a>&nbsp;
         <a href={dlhref} className="attachment-download"><i className='icon-cloud-download'></i></a>

+ 3 - 3
apps/app/src/services/renderer/renderer.tsx

@@ -49,7 +49,7 @@ export const commonSanitizeOption: SanitizeOption = deepmerge(
   rehypeSanitizeDefaultSchema,
   baseSanitizeSchema,
   {
-    clobberPrefix: 'mdcont-',
+    clobberPrefix: '', // remove clobber prefix
   },
 );
 
@@ -93,14 +93,14 @@ export const verifySanitizePlugin = (options: RendererOptions, shouldBeTheLastIt
 export const generateCommonOptions = (pagePath: string|undefined): RendererOptions => {
   return {
     remarkPlugins: [
-      [toc, { maxDepth: 3, tight: true, prefix: 'mdcont-' }],
+      [toc, { maxDepth: 3, tight: true }],
       gfm,
       emoji,
       pukiwikiLikeLinker,
       growiDirective,
     ],
     remarkRehypeOptions: {
-      clobberPrefix: 'mdcont-',
+      clobberPrefix: '', // remove clobber prefix
       allowDangerousHtml: true,
     },
     rehypePlugins: [

+ 27 - 0
apps/app/src/styles/organisms/_wiki.scss

@@ -157,6 +157,33 @@
     }
   }
 
+  // see: https://github.com/micromark/micromark-extension-gfm-footnote#css
+  /* Style the footnotes section. */
+  .footnotes {
+    font-size: smaller;
+    color: bs.$text-muted;
+    border-top: 1px solid bs.$border-color;
+    /* Hide the section label for visual users. */
+    #footnote-label {
+      position: absolute;
+      width: 1px;
+      height: 1px;
+      padding: 0;
+      overflow: hidden;
+      clip: rect(0, 0, 0, 0);
+      word-wrap: normal;
+      border: 0;
+    }
+  }
+  /* Place `[` and `]` around footnote references. */
+  [data-footnote-ref]::before {
+    content: '[';
+  }
+
+  [data-footnote-ref]::after {
+    content: ']';
+  }
+
   $ratio: 0.95;
 
   &.comment {

+ 2 - 2
apps/app/test/cypress/integration/20-basic-features/20-basic-features--access-to-page.spec.ts

@@ -22,7 +22,7 @@ context('Access to page', () => {
 
   // TODO: https://redmine.weseek.co.jp/issues/109939
   it('/Sandbox with anchor hash is successfully loaded', () => {
-    cy.visit('/Sandbox#Headers');
+    cy.visit('/Sandbox#headers');
     cy.waitUntilSkeletonDisappear();
 
     // for check download toc data
@@ -35,7 +35,7 @@ context('Access to page', () => {
     // remove animation for screenshot
     // remove 'blink' class because ::after element cannot be operated
     // https://stackoverflow.com/questions/5041494/selecting-and-manipulating-css-pseudo-elements-such-as-before-and-after-usin/21709814#21709814
-    cy.get('#mdcont-headers').invoke('removeClass', 'blink');
+    cy.get('#headers').invoke('removeClass', 'blink');
 
     cy.collapseSidebar(true);
     cy.screenshot(`${ssPrefix}-sandbox-headers`);

+ 1 - 1
apps/app/test/cypress/integration/21-basic-features-for-guest/21-basic-features-for-guest--access-to-page.spec.ts

@@ -20,7 +20,7 @@ context('Access to page by guest', () => {
     // remove animation for screenshot
     // remove 'blink' class because ::after element cannot be operated
     // https://stackoverflow.com/questions/5041494/selecting-and-manipulating-css-pseudo-elements-such-as-before-and-after-usin/21709814#21709814
-    cy.get('#mdcont-headers').invoke('removeClass', 'blink');
+    cy.get('#headers').invoke('removeClass', 'blink');
 
     cy.screenshot(`${ssPrefix}-sandbox-headers`);
   });

+ 10 - 0
turbo.json

@@ -19,6 +19,11 @@
       "cache": false
     },
 
+    "micromark-extension-gfm-table#build": {
+      "outputs": ["index.js", "index.d.ts", "lib/**"],
+      "inputs": ["dev/**/*.js", "tsconfig*.json"],
+      "outputMode": "new-only"
+    },
     "@growi/remark-attachment-refs#build": {
       "dependsOn": ["@growi/core#build", "@growi/remark-growi-directive#build", "@growi/ui#build"],
       "outputs": ["dist/**"],
@@ -63,6 +68,11 @@
       "outputMode": "new-only"
     },
 
+    "micromark-extension-gfm-table#dev": {
+      "outputs": ["index.js", "index.d.ts", "lib/**"],
+      "inputs": ["dev/**/*.js", "tsconfig*.json"],
+      "outputMode": "new-only"
+    },
     "@growi/remark-attachment-refs#dev": {
       "dependsOn": ["@growi/core#dev", "@growi/remark-growi-directive#dev", "@growi/ui#dev"],
       "outputs": ["dist/**"],