Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixed linking using urlGenerator for AddPostMentionsFormatter #11

Closed
wants to merge 2 commits into from
Closed

fixed linking using urlGenerator for AddPostMentionsFormatter #11

wants to merge 2 commits into from

Conversation

luceos
Copy link
Member

@luceos luceos commented Sep 18, 2015

ready for merging, after the PR from core is done:

flarum/framework#518

@tobyzerner
Copy link
Contributor

Relevant: flarum/framework#123

@luceos
Copy link
Member Author

luceos commented Sep 18, 2015

This is done see flarum/framework#518 and flarum/framework#123

@tobyzerner
Copy link
Contributor

There are two stages of text formatting:

  1. When the post is saved, the raw content is parsed into XML and stored in the database.
  2. When the post needs to be rendered, the XML is rendered into HTML.

One of the benefits of having these split up is that we can put off stuff like URL generation until the rendering step. That way, if the forum's URL structure ever changes, mentions that have already been parsed won't break!

This PR is generating the URLs on the parsing step, which is not what we want.

@luceos
Copy link
Member Author

luceos commented Sep 19, 2015

@tobscure I'm still trying to figure out the eco system. And if I compare both files (and their results in my database):

<r><p><POSTMENTION id="21" username="luceos">@luceos#21</POSTMENTION></p> 

<p><USERMENTION id="1" url="https://laravel.today/u/luceos" username="luceos">@luceos</USERMENTION></p> </r>

The postmention works, but the usermention does not. I however do not see the difference in the code, could you point me out how the usermention parses the url earlier? There does seem to be coming in a call on render but I'm not sure where it originates from.

@tobyzerner
Copy link
Contributor

Closing as this is very outdated. It's been half fixed in the recent months – we now use the URL generator to get the base URL, but we still append the discussion/user ID onto the end of that which isn't ideal. The solution is here: s9e/TextFormatter#23

@luceos
Copy link
Member Author

luceos commented Feb 7, 2016

Didn't even remember opening this one. So 👍

@luceos luceos deleted the fix_mentioning branch February 7, 2016 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants