question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Enabling superscript and/or subscript doesn't work.

See original GitHub issue

🐛 Bug Report

Enabling superscript and/or subscript doesn’t work.

Have you read the Contributing Guidelines on issues?

Yes

To Reproduce

(Write your steps here:)

  1. Install and initialize docusaurus 1.14 (npx docusaurus-init)
  2. Enable sup and sub in remarkable (siteconfig.js) as described in docs: https://docusaurus.io/docs/en/site-config.
markdownPlugins: [
  function foo(md) {
    md.inline.ruler.enable(['sub', 'sup']);
  },
],
  1. Add page with 1 tag or ^1^ (doc2 in demo)

Expected behavior

The 1 character or “st” should be rendered to html superscript

Actual Behavior

The 1 character and “st” are rendered as regular text in html.

Your Environment

  • Docusaurus version used: 1.14
  • Environment name and version (e.g. Chrome 78.0.3904.108, Node.js 10.17.0): Chromium 83.0.4103.106, Node.js 12.16.2
  • Operating system and version (desktop or mobile): Windows 10 1909

Reproducible Demo

https://github.com/jodibooksHQ/docusaurus-bug-2979

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
slorbercommented, Jun 2, 2021

the latest version of docusaurus throws if you attempt to supply remarkPlugins in the config

This is plugin option config, not global site config (also why it’s not in the global config validation logic)

Added documentation for Katex today: https://docusaurus.io/docs/next/markdown-features/math-equations

If you want to enable extra md features on v2, you can pass remark plugins as documented (not in the migration guide)

Going to close as we likely won’t do anything for v1

1reaction
joeplaacommented, May 25, 2021

@naddeoa I ran into the same issue with the documentation about plugins being (still) a bit vague. Hopefully they will be improved soon, now that v2 is out of alpha. I don’t have a straight answer for you as I’m also “just” a Docusaurus user, but maybe this will help you along.

  1. import / require plugins at the top of docusaurus.config.js:
const remarkMath = require('remark-math');
const rehypeKatex = require('rehype-katex');
  1. now also in docusaurus.config.js add to presets (not plugins !?):
presets: [
        [
            `@docusaurus/preset-classic`,
            {
                blog: {},
                docs: {
                    showLastUpdateAuthor: true,
                    showLastUpdateTime: true,
                    path: `docs`,
                    remarkPlugins: [remarkMath],
                    rehypePlugins: [rehypeKatex],
                    sidebarPath: require.resolve('./sidebars.json')
                },
                sitemap: {
                    changefreq: 'weekly',
                    priority: 0.5,
                    trailingSlash: false
                },
                theme: {
                    customCss: [require.resolve(`./src/css/custom.css`)]
                }
            }
        ]
    ],
Read more comments on GitHub >

github_iconTop Results From Across the Web

Fix Google Docs Superscript Not Working - Technipages
If you can't use the superscript feature in Google Docs, we've got a series of handy solutions to help you troubleshoot this issue....
Read more >
Keyboard Shortcut in Docs Not Working for Superscript
Keyboard Shortcut in Docs Not Working for Superscript · On your computer, open Chrome. · At the top right, click More Settings. ·...
Read more >
Format text or numbers as superscript or subscript
Press CTRL+1. Under Effects, check the Superscript or Subscript box, and click OK.
Read more >
How to Add a Superscript or Subscript in Microsoft Word
1. Select the text you want to format as either a superscript or subscript. · 2. In the ribbon, click the "Home" tab...
Read more >
MS Word equations don't permit subscripts or superscripts
In the font section of the "home" tab the sub and superscript icons are grayed out AND the shortcuts to sub and superscripts...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found