You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The href and sometimes the ID directly reflects a filepath. One issue with this is that filenames aren't always URL safe. Since this is being used in the web, it should be web-safe. However, I consider the current implementation being excessively complex and overstepping some bounds (the unwanted behavior).
Current solution to mitigate the above.
During parsing, the element IDs with periods are replaced with underscore.
When getting content, extensions and sub paths are removed as well doing step 1 again.
Example issues
In the sister project, I am using the id as dynamic routes. One issue with this is that setting the url to have a file extension would result in the browser/server attempting to find that resource (E.g. An id "chapter1.html" will be fetched). Even though that it is url safe
Background
The href and sometimes the ID directly reflects a filepath. One issue with this is that filenames aren't always URL safe. Since this is being used in the web, it should be web-safe. However, I consider the current implementation being excessively complex and overstepping some bounds (the unwanted behavior).
Current solution to mitigate the above.
Example issues
New solution
Simply URL-encode element IDs, HREFs, and anchor tags.