Comments (9)
Thanks for reporting. I will look into it.
from madness.
I think it should work now in the edge version.
Can you verify it works for your case?
from madness.
I've build it from origin/fix/diacritics-in-ids branch (hopefully that's what i should have done) and now none of my links work. But I do see some change in the generated webpage.
<h2><a id='24-prava-plastov-krabiky-pro-elektroniku'></a>2.4. Úprava plastové krabičky pro elektroniku</h2>
has changed to:
<h2 id="2-4-prava-plastov-krabi-ky-pro-elektroniku">2.4. Úprava plastové krabičky pro elektroniku</h2>
It's Czech language if that helps.
from madness.
Well. Let's take a step back.
- As it turns out, the current (released) version is working as expected.
- IDs are added to headers automatically, with diacritics removed - this is done by RedCarpet, and not under my control.
- The
<!-- TOC -->
magic comment, adds the same type of slugs, with diacritics removed completely. - So - in essence - the released version is working as expected.
I was using this markdown document to test:
<!-- TOC -->
## 2.4. Úprava plastové krabičky pro elektroniku
which resulted in this HTML:
<ul>
<li><a href="#2-4-prava-plastov-krabi-ky-pro-elektroniku">2.4. Úprava plastové krabičky pro elektroniku</a></li>
</ul>
<h2 id="2-4-prava-plastov-krabi-ky-pro-elektroniku">2.4. Úprava plastové krabičky pro elektroniku</h2>
with identical IDs, as expected.
Now - I totally agree that the IDs should contain diacritics - especially if this is how GitHub does it.:
2.4. Úprava => 2-4-úprava # good
2.4. Úprava => 2-4-prava # bad
but, unless this is changed in RedCarpet, I don't think there is much I can do about it.
I have opened an issue: vmg/redcarpet#739
So to recap:
- If you were referring to the links generated by the
<!-- TOC -->
marker - they should work in the released version. If they are not, I need you to provide me with a minimal markdown text and/or filename to reproduce. - If you are linking to header IDs manually - you will have to use the same IDs like the ones that are generated (i.e. with diacritic letters erased altogether).
As a side note - I see that filenames with diacritics are not currently supported.
from madness.
Thank you for looking into this and for escalating it.
from madness.
Version 1.2.0 is now released, with support for pandoc
as an alternative markdown renderer. When using renderer: pandoc
in .madness.yml
settings, headers with diacritics should work properly in Table of Contents.
Note that this requires having pandoc
installed, but it should be as simple as brew install pandoc
or any other OS package manager (apt / apk etc).
If anyone can confirm this works, or report that it doesn't, it will be appreciated.
from madness.
Is the docker image updated with support for pandoc renderer?
from madness.
Yup.
Line 3 in 0fbe1e9
from madness.
I also had to remove leading numbers and dots from Table of Contents links, since pandoc removes them from header IDs.
madness/lib/madness/inline_table_of_contents.rb
Lines 41 to 42 in 0fbe1e9
When using pandoc, headers that look like ## 2.4 Hello World
will get the id hello-world
by pandoc, so the ToC does the same.
from madness.
Related Issues (20)
- Howto set an "alias" in Windows Powershell? HOT 3
- Mobile Search HOT 6
- Support for Obsidian-style [[links]] and information about backlinks HOT 5
- .madness.yml not being read? HOT 2
- Support for subpath with reverse proxy HOT 29
- Settings cannot take effect HOT 3
- Allow to automatically add a link from every page to the corresponding source file HOT 16
- Create JSON schema for config HOT 6
- Add JSON schema test
- Allow to optionally decouple file and directory names from display names HOT 7
- An option to highlight a "Note" and "Warning" using blockquote HOT 3
- Docker version 1.1.3 fails to start missing gem HOT 7
- Escape characters in a table HOT 4
- Help ordering file and folder HOT 5
- Markdown files with a name overlapping that of a folder don't open via links HOT 25
- Madness and Github pages HOT 3
- TOC generation (1.1.4) looks inside code blocks HOT 4
- Breadcrumbs are problematic HOT 7
- ToC levels for not autogenerated ToC are not honored HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from madness.