User cards with <hr>s cause wrong descriptions


#1

The bug: When you open a user card that has a <hr> in its description, all other user cards you’ll open until the next full reload will look like the one with the <hr> in it.

I added one to my user card here, in case someone wants to see a repro.

Link to another card: @system


(Apparently Archetype) #2

I believe you should have the same issue with my user card.

you certainly do with it on another discourse forum i frequent.

my user card:

Not necessarily evil, but most definitely mischievous.

---

Oh hi, you looked below the fold! have a :cookie:

(Apparently Archetype) #3

interesting. you also can’t see anything below the HR in my user card either…

not sure if that’s by design or not though.


(Jeff Atwood) #4

Hmm that is a very weird one, @eviltrout you should have a look.


#5

It’s


's all the way down.

(Robin Ward) #6

We use a jquery plugin there to trim long profiles so they don’t take up too much vertical space, and insert an ellipsis afterwards. The issue here is the <hr> adds a lot of vertical space so it doesn’t have a place to insert the ellipsis.

I’m not sure what an appropriate fix would be here – not allow users to insert <hr> tags? Strip them from cards?


(mountain) #7

I think this is a reasonable solution.


#8

But how does that explain subsequent user cards showing the old stuff?

I mean, the truncation is the least problematic part of this. It makes sense for a user card. Showing the same thing for other users is clearly a bug.


(Robin Ward) #9

Yes sorry, there was also a bug with the ellipsis library. I didn’t mention it but I will fix it at the same time as we come up with a solution.


#10

And the markdown aliases for <hr/>, unless they’re used for <h1>s?
Although, wouldn’t headlines also invisibilify ellipses, too?
EDIT: Didn’t realize that <h1>s do get stripped from the card - but not from the profile.


#11

Actually, that’s only half-true:

  1. <h1> - headlines show up both in profile and user card
Your text here
---

These show up in the profile, but not in the user card
3. #Your text here - headlines show up both in profile and user card

And guess what, headlines that appear in the user card have weird ellipses. But they don’t seem to overwrite other cards.


#12

If only the user card description were itself a post, surely this entire catastrophe would be averted?

Andre the Giant thinks so anyway.


(Sam Saffron) #13

We should get this sorted for next release, its kind of bad.


(Sam Saffron) #14

Fixed via:

Long term we want to think about which tags and styling we really want to allow in the card.


(Sam Saffron) #15

(Kane York) #16

This topic is now opened. New replies are allowed.


Issue is not fixed. This isn’t my bio:

I don’t think anything is special about the hr that’s causing this.


(Sam Saffron) #17

Its this magic jquery thing, at this point if we are just going to be fighting with the html I am simply going to strip all markup out and get rid of the crazy plugin


(Kane York) #18

I’m in favor of getting rid of a crazy jQuery plugin causing us problems… is it the thing responsible for truncation to a reasonable height?


#19

Probably any singular html element that doesn’t close causes pisspoor html regex parser of a jquery plugin to crap bricks (img tags are the new culprit)?

Didn’t @codinghorror make a blog about this…


#20

Testing… My profile has this html: (temporarily)

<img title=“fakemoji!” src= width=20 height=20 class=“emoji”></img>

It closes, but the there’s no actual image…

Edit, testing with actual image, still works.

<img title=“fakemoji!” src=http://forum.kerbalspaceprogram.com/images/smilies/k_kiss.gif width=20 height=20 class=“emoji”></img>