WIP permalink anchor stripping#982
Conversation
gijsk
left a comment
There was a problem hiding this comment.
Thanks for working on this and apologies for the slow response! I've been sidetracked by various other things including some time off.
The code change looks reasonable though I would probably not replace the SVG with anything at all?
However, I am unable to create a test from a source file locally. I run it with the node command, but the content is not generated...
Can you say more about this? What exactly are you running and what is the result?
Off-hand I would expect npm run generate-testcase <slug> to regenerate the testcase, and this WFM on my machine. Do you get an error instead?
I think updating the testcases is the only other thing that would stop this from being merged. 🙂
Yup, I understand completely. I would have eventually closed this PR in six months time 😁
My rational for replacing the svg with a "#" is to keep the anchor. I believe I saw some tests that expected anchors to stay and be displayed as #.
I'll get back to you on that, I seem to remember having managed to create the test case.
That part scares me a bit. Can I modify expected content in those test cases that fail ? What are the guidelines for that ? |
Hm - can we only do this if there is nothing else in the link (ie there are no element children left)?
Thanks!
You can re-run |
This PR aims to fix #965.
The initial method would be to remove the SVG files or element, and replace it with either a
#.The presence of a hidden span with permalink could also be a pattern for recognition.
However, I am unable to create a test from a source file locally. I run it with the node command, but the content is not generated...
Comments on method or best practices are more then welcome.