Closed tv42 closed 4 years ago
In #93 I just escaped funky inputs like RenderAttributes
would have, but blackfriday actually has a better policy that I just couldn't implement as easily: a slugify
function that converts non-alphanumerics to dashes, while ensuring no leading/trailing dashes and only one dash in a row. If you like the PR, I should add that before this goes live...
I do not care about compatilibity with blackfriday. Non-standard behavior should not be included as a built-in feature in goldmark because it is hard to implement certain non-standard feature that satisfies all users.
So it is preferable for me that we modify goldmark as you easily implement this feature as an extension. You can make this kind of PR?
Non-standard behavior should not be included
By that argument, rip out the current footnote extension, as footnotes are not in CommonMark.
I'll make my code an independent extension and stop using whatever current footnote functionality exists. At this time at least, I believe nothing else is needed from goldmark; I was merely trying to avoid reimplementing/copy-pasting the existing footnote code.
@yuin I totally understand not wanting to add the functionality to the core of Goldmark. Would you prefer to see this as a separate extension, then? Or a configuration flag on the existing extension?
(Since there seems to be momentum over on this side, I'll close my #90 PR.)
@sjml I prefer to see this as a separate extension. And as I wrote above it is preferable for me modifying goldmark as you can easily implement this feature as a separate extension(e.g.: add some hook function options to the built-in footnotes extension).
@yuin That makes sense. I'll see what I can whip up. Would you consider adding such a separate extension to this repository, or would it need to be its own thing entirely?
@sjml It should be maintained in a separated repository.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@tv42 or @sjml Did either of you create an extension for this? Might be useful to link it from here so people can find it when the find this issue. Thanks!
I didn't because the Hugo maintainers didn't seem interested in using third-party plugins, so that ended up being a dead-end unless I wanted to always be maintaining my own branch of Hugo. :( The code I submitted in PR #90 could easily be used to make a separate plugin, though.
Thanks @sjml. It's too bad, because it means my footnotes are broken in list pages. I asked about it in this post (which is how I was led to this ticket).
Yeah, I tried to see if there was any interest in it in this post but got no traction. I ultimately ended up moving away from Hugo entirely so I could have a little more flexibility (which I'm willing to trade speed for at my scale). But at this point we're off-topic of this issue. :)
@theory I kinda gave up on it for now, too. I'll probably make the extension if & when I migrate out of Hugo again.
Please answer the following before submitting your issue:
blah[^name] ... [^name]: more
name
, retain backwards compatibility with existing website using blackfriday.fn:1
FootnoteHTMLRenderer
, and the way it uses private methods and registration it doesn't seem like I could easily wrap & extend it.It seems like this would be a simple enhancement to current footnote extension. If
n.Ref
is not numeric, use it instead ofn.Index
.