Superscript doesn't work (unsafe = true)

Continuing the discussion from Footnote sup tag not working inside markdownify. help:

excuse my korean :sweat_smile:

config.toml:

baseURL = "https://freshrimpsushi.github.io/"
title = "생새우초밥집"

#core 1
languageCode = "ko"
DefaultContentLanguage = "ko"
hasCJKLanguage = "true"
googleAnalytics = ""

#core 2
relativeURLs = true
enableInlineShortcodes = true

# core 3
paginate = 10
footnoteReturnLinkContents = "^"

# optional
unsafe = "true"
enableEmoji = ""
disqusShortname = ""

summaryLength=150

[permalinks]
  post = "/:slug/"
  posts = "/:slug/"
  page = "/:slug/"
  r_ = "/:slug/"
  j_ = "/:slug/"

[taxonomies]
  category = "categories"
  tag = "tags"
  archive = "archives"

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

[sitemap]
  filename = "sitemap.xml"  # c.f. https://gohugo.io/templates/sitemap-template/#configure-sitemap-xml

(unsafe = “true”) also doesn’t work.

my_typora_editor.md:
image

result:
image

Your configuration above is invalid because the unsafe parameter needs to be entered within the markup table. Please try:

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

Also see: Configure Markup | Hugo

Please check my config.toml again?
I already entered exactly same code,

...

[taxonomies]
  category = "categories"
  tag = "tags"
  archive = "archives"

[markup]
  [markup.goldmark]
    [markup.goldmark.renderer]
      unsafe = true

[sitemap]
  filename = "sitemap.xml"  # c.f. https://gohugo.io/templates/sitemap-template/#configure-sitemap-xml

Right I just saw that the markup table was further down. Sorry.

What is your Hugo version?

You will most likely need to provide a repository that reproduces the issue.

Oh, i see.

window 10

PS D:\admin> go version
go version go1.15.6 windows/amd64
PS D:\admin> hugo version
Hugo Static Site Generator v0.80.0-792EF0F4 windows/amd64 BuildDate: 2020-12-31T13:37:57Z

More information?

If others managed to render the <sup> tag, with the above Goldmark configuration, as discussed in the topic you linked to above and you cannot get it working, then you will have to share your project for us to see what is going on.

How can i share? github?

This is project:

This is webpage:
freshrimpsushi.github.io

I can’t find that file in your repository.
Also: It appears you are using an IntelliJ project per content subfolder. These .idea subfolders should only exist at the root level. This is probably not connected, but might lead to other issues.

Sorry.

my_typora_editor.md:

web page:
https://freshrimpsushi.github.io/prokaryotes-and-eukaryotes/

Also: I deleted .idea! Thank you!

You have not enabled the footnotes extension in the Goldmark configuration.

Change the relevant config section to the following:

[markup]
  [markup.goldmark]
    [markup.goldmark.extensions]
      footnote = true
    [markup.goldmark.renderer]
      unsafe = true

And then the superscript footnote on line 21 will be rendered.

Also please have one more look at the documentation at: Configure Markup | Hugo

Thank you for your attention and advise. I will read Configure Markup | Hugo again and again.

But it still doesn’t work.

And and i found other issue:


These bold text are exactly same in markdown file.(Never mind about mathjax error. I can handle this.)

I guess that these are occurred by same reason. In my first screenshot also, even bold texts are not rendered. I can give up using superscript, but bold text issue is quite critical to me.

This is how you write footnotes:

**1.** 핵막이 없는 생물을 **원핵 생물[^Prokaryotes]**이라 한다.
<!-- footnote ok, not bold -->

**2.** 핵막이 있는 핵으로 이루어진 생물을 **진핵 생물^Eukaryotes^**이라 한다.
<!-- footnote not ok, not bold -->

진핵 생물에서는 유전 물질을 지니는 부분인 **세포핵[^Nucleus]** 과 각종 대사가 일어나는 
<!-- footnote ok, bold ok -->

[^Nucleus]: foo

[^Prokaryotes]: bar

[^Eukaryotes]: baz

image

Yes, footnotes are fine. Superscripts and bold text are matters.

So, to clarify, you are asking about using superscript notation? Not about footnote superscript rendering?

Superscripts are not part of the CommonMark spec, which is why in the topic you link to, the poster is using <sup>foo</sup>, and unsafe to render raw html in markdown.

부분인 **세포핵<sup>Nucleus</sup>** 과 각종

image

Footnotes were not rendering in the repo you provided above, when I tested it, due to not enabling Goldmark’s footnote extension.

Also I have marked @pointyfar 's post above as the solution.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.