-
Notifications
You must be signed in to change notification settings - Fork 23
Description
Expected Behavior
While reporting dita-ot/docs#607, @stefan-jung discovered:
I tried to modify the following topic with the Edit this page button:
https://www.dita-ot.org/dev/topics/plugin-messages#ariaid-title1
— but it didn't work.
Actual Behavior
oXygen XML Web Author returns an error that it can't find the resource to edit.
Looks like a side-effect of Netlify’s post-processing for pretty URLs.
At first glance, it looked like the trailing fragment identifier #ariaid-title1 that Algolia adds when you follow links in the site search results could be to blame.
But stripping that isn’t enough. Web Author also doesn’t find the topic under topics/plugin-messages.
It seems Web Author relies on the .html file name extension to locate the corresponding .dita source file.
If you manually edit the URL in your browser to topics/plugin-messages.html and then click Edit this page, it works.
Possible Solution
We’d probably need to edit the logic in the parse() function on lines 55–56 of the EditController.js file.
Not sure if there's a concise (and resilient) way of refactoring that that would work with the pretty URL syntax. 🤔
One thing that comes to mind would be walking the URL backward from the end to find the last slash /, then using the final sequence of letters, dashes, or underscores that construct the root filename, ignoring any trailing fragment identifiers.
— but there may be a better way.
@raducoravu, @jelovirt Any suggestions?