StoryParser turns anchor links into absolute links to original page

Description

When importing a work from an external site, the StoryParser turns all anchor links (eg `#notes`) to absolute links that refer back to the original site. As these are probably going to be internal links that should be kept on AO3 (chapter links, hypertext cross-references, links to individual end notes), we should keep them as is.

https://github.com/otwcode/otwarchive/blob/be81dfa7d28382286186dd820fdf4e31bdd5ef4f/app/models/story_parser.rb#L554-L561 should be changed to exclude anchor links.

Testing Notes

When importing a work which contains links to anchors within the document (eg: #notes), the links should no longer be turned into absolute links to the external site url.

Activity

Show:
Sarken
April 9, 2019, 12:13 PM

This doesn't mention needing to use the temporary site, so I just tested as a regular user. I posted an entry on Dreamwidth with the content:

When I imported it, the anchor kept me on the page on the Archive: https://test.archiveofourown.org/works/1069453

Looks good!

Lady Oscar
April 11, 2019, 1:45 AM

Looks good!

DeployedToBeta

Assignee

Ariana

Reporter

Ariana

Roadmap

Work Importing

Priority

Medium

Affects versions

Fix versions

Components

BackEnd

Difficulty

Medium

Required Access Level

Archivist

Milestone

Internal 0.9