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
code block may block item links #125
Comments
I have this issue too! See screendump here http://dl.dropbox.com/u/4423356/biostar_issue.png and my user profile http://www.biostars.org/user/profile/446/ Cheers, Steve |
I've been trying to have a little poke around and sort this out. It seems to be something to do with {{ note.html|safe }} in main/server/templates/user.profile.html. What exactly does that do? Are the notifications created when comments etc. are made, or are they rendered on the fly? It seems to be killing links to the posts when they are evaluated within code blocks. |
It probably comes from earlier where a note is generated on an action. A note is basically a little text snipped that describes an action and is created upon post creation. After this snippet the link is included separately. The code responsible for it is the function post_action in https://github.com/ialbert/biostar-central/blob/master/main/server/notegen.py Now the content of the note is just a partial content of the post but since it is html that I am trimming back I think the problem ends up being that some html tags remain open and that interacts with the link that follows it. This problem is also likely to manifest itself differently in different browsers since it is a matter of trying to display occasionally incorrect markup. The real solution is to trim back the original markup to be shorter, and from that generate a new html rather than taking the html and chopping it off. |
Could you add some checks in under the chop subroutine, to sanitise the HTML tags? Perhaps using BeautifulSoup or Tidy? From what I can tell, it seems to be closing off the tags after the postlink, but it should probably be doing it before. |
On Wed, May 9, 2012 at 3:34 PM, Steve Moss
well, detecting that is not that easy since tags can nest etc. |
From: Ryan Thompson rct@thompsonclan.org
To: biostar-central biostar-central@googlegroups.com
Cc:
Date: Sun, 15 Apr 2012 15:58:50 -0700 (PDT)
Subject: Bug: User activity page links broken by code blocks
If you look at the activity page on my profile, you can see that in
one of the entries, the link to the activity item is trapped inside a
code block and therefore visible as raw Markdown and not a clickable
link.
http://www.biostars.org/user/profile/285/
-Ryan
The text was updated successfully, but these errors were encountered: