1
0

Rewriting relative URLs #45

Open
dswd wants to merge 2 commits from unknown repository into master
dswd commented 2014-09-17 15:25:08 +01:00 (Migrated from github.com)

Convert relative URLs embedded in the content to absolute URLs so that they point to the correct destination. This rewrites URLs based on the following rules:

  • If the URL contains a colon like in 'http://' or 'https://' or 'mailto:' it is considered absolute and not rewritten
  • If the URL starts with a hash, it is considered a page-internal anchor that does not have to be rewritten
  • If the URL starts with a double slash, it is considered absolute and not rewritten
  • Anything else that starts with a slash is rewritten by prepending the host part (everything before the first slash, after the first double-slash) of the original URL
  • Anything else is rewritten by prepending the directory part (everything before the last slash) of the original URL
Convert relative URLs embedded in the content to absolute URLs so that they point to the correct destination. This rewrites URLs based on the following rules: - If the URL contains a colon like in 'http://' or 'https://' or 'mailto:' it is considered absolute and not rewritten - If the URL starts with a hash, it is considered a page-internal anchor that does not have to be rewritten - If the URL starts with a double slash, it is considered absolute and not rewritten - Anything else that starts with a slash is rewritten by prepending the host part (everything before the first slash, after the first double-slash) of the original URL - Anything else is rewritten by prepending the directory part (everything before the last slash) of the original URL
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mbirth/ttrss_plugin-af_feedmod#45
No description provided.