Let (de)wikify handle anchors in links #235
No reviewers
Labels
No labels
Component: User interface
Component: Wymeditor
Help wanted
Level: Difficult
Level: Easy
Level: Moderate
Pagetype: Festival
Pagetype: Mailinglist
Pagetype: Peer reviewed article
Pagetype: Text
Privacy GDPR AVG
status: has conflicts
Status: Needs changes
Status: Needs discussion
Status: Needs review
Status: Ready to merge
Status: Waiting for response
Type: Bug
Type: Enhancement
Type: Question
Usecase: De Stadsbron
Usecase: Koppelting
Usecase: MeetjeStad
Value: Coders
Value: Security
Value: Users
Value: Visitors
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
harmen/hypha!235
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-anchors"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Before, it would treat the anchor part of a link as part of the
pagename and would create empty pages called e.g.
page_name#anchor.Since the links would still be dewikified back to their original value,
the anchors would actually work, but once these dummy pages are deleted,
dewikifying of the links breaks.
To simplify parsing the urls in wikify and dewikify, a regex is used
instead of adding another layer of explode calls.
A unittest would come in handy now, perhaps we should introduce them.
Regular expressions are, for a lot of people, hard to read. A comment, explaining what it does, would be helpful.
I do agree. For non-programmers like me, regex are hell.
I've added some comments, simplified the regex (while explaining it I realized it was overcomplicated) and rebased.
@laurensmartina @tammoterhark, does this comment make things more clear for you?
Handling the uri can and should be done in the same manner as in
HyphaRequest.Seems like duplicate behaviour to
HyphaRequest. The method inHyphaRequestis way more extensive and seems to cover more cases.Good point, I'll see how we can adapt this to involve HyphaRequest (probably requires some changes to HyphaRequest as well).
@laurensmartina, it turns out using
HyphaRequestfor parsing these urls is a bit more involved and requires changes toHyphaRequest. How about we merge this as-is with a regex (since it does fix something right now) with a TODO and then fix this as part of #274?If you agree, I'll do one more pass over the code, add the TODO and merge it :-)
Yes, it makes it clear.
agreed