document base url does not update when URL changes in a single-page-app?
See original GitHub issueI discovered a bug in my app that uses tinymce-react, related to the handling of relative URLs. I’m not certain, but I’m guessing that it’s related to how document_base_url
is handled.
Here’s how I’ve observed the bug:
- Page loads with a url like
dashboard.wikiedu.org/courses/My_School/My_course_(Fall_2018)
- User navigates to
dashboard.wikiedu.org/courses/My_School/My_course_(Fall_2018)/timeline
- TinyMCE field contains a link like
/training/students/getting-started
. - After saving, the now-relative updated url is one level off of what it originally was.
In contrast, the relative url is still pointed to the correct place after saving if the user loads dashboard.wikiedu.org/courses/My_School/My_course_(Fall_2018)/timeline
initially.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
React-router URLs don't work when refreshing or writing ...
I added --history-api-fallback parameter in package.json file. Then page refreshing is working correctly. Each when I change code, web page is refresh ......
Read more >The Document Base URL element - HTML - MDN Web Docs
The HTML element specifies the base URL to use for all relative URLs in a document. There can be only one element in...
Read more >Add a Base URL to an App Using Redux and React Router
In this guide, you will learn how to set up a base URL in React Router and how to combine Redux seamlessly.
Read more >Fixing the 'cannot GET /URL' error on refresh with React ...
In this post you'll learn how to fix the 'cannot GET /URL' error ... no longer making requests to your server every time...
Read more >Configuring the URL strategy on the web - Flutter documentation
Update the <base href="/"> tag in web/index.html to the path where your app is hosted. For example, to host your Flutter app at...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@ragesoss, Setting the convert_url option to false fixes the issue in your reproduction app. I’ll be closing this now but let me know if you’re still having the issue and this doesn’t work out for you in your real use case!
@SimonFc thanks! Didn’t see this until now, but I thought I had worked around the situation in my app… discovered today that the workaround wasn’t quite complete, and went searching for this thread. Yep,
convert_urls: true
fixed it.