X-Git-Url: http://git.vanrenterghem.biz/git.ikiwiki.info.git/blobdiff_plain/5150874861509b45835c7bd9565531b550a35db5..6ab4dee7287ee13d21435402234eef3c93f1841e:/doc/plugins/contrib/i18nheadinganchors/discussion.mdwn diff --git a/doc/plugins/contrib/i18nheadinganchors/discussion.mdwn b/doc/plugins/contrib/i18nheadinganchors/discussion.mdwn index 1c3eb6325..716fc0902 100644 --- a/doc/plugins/contrib/i18nheadinganchors/discussion.mdwn +++ b/doc/plugins/contrib/i18nheadinganchors/discussion.mdwn @@ -1,5 +1,5 @@ I would not be comfortable with merging this into headinganchors and enabling it by -default for two reasons: +default for two main reasons: * it adds a new dependency on [[!cpan Text::Unidecode]] * Text::Unidecode specifically documents its transliteration as not being stable @@ -36,16 +36,39 @@ So perhaps we could try this Unicode-aware version of what Pandoc documents: an unused identifier (Or to provide better uniqueness, we could parse the document looking for any existing -ID, then generate IDs avoiding collisions with any of them.) +ID, then append `-1`, `-2` to each generated ID until there is no collision.) This would give us, for example, `## Visiting 北京` → `id="visiting-北京"` -(where Text::Unidecode would instead transliterate, resulting in `id="visiting-bei-jing"`). +(whereas Text::Unidecode would instead transliterate, resulting in +`id="visiting-bei-jing"`). To use these IDs in fragments, I would be inclined to rely on browsers supporting [IRIs](https://tools.ietf.org/html/rfc3987): ``. --[[smcv]] + +---- + +Documentation says: + +> _Also note that all heading attributes are overriden with the ID tag. If this +> is not desirable, we'd need to fire up a full HTML::Parser or do some more +> regex magic to preserve the attributes other than id= which we want to keep._ + +I think this is a bug, particularly if you are using Pandoc's +[header attributes](http://pandoc.org/MANUAL.html#extension-header_attributes) +or similar. + +I think we should try to use an existing ID before generating our own, with the +generation step as a fallback, just like Pandoc does. If a htmlize layer like +Text::MultiMarkdown or Pandoc is generating worse IDs than this plugin, the +the right solution to that is to send a bug report / feature request to +make its IDs as good as this plugin's, or turn off ID generation in the +htmlize layer, or stop using Text::MultiMarkdown. + +--[[smcv]] + ----
Some long scrollable text
@@ -66,7 +89,7 @@ supporting [IRIs](https://tools.ietf.org/html/rfc3987): `Example fragment ID in Russian should point here
+Example fragment ID in Russian should point here
 .
 .
 .