Posts with ##Headlines broken after 1.8->1.9 upgrade


(ljpp) #1

The markdown interpreter seems to have changed a bit.

Previously (up to 1.8) lines starting with # were always treated as headlines.

##Headline

However, after 1.9 upgrade it requires an extra space between the # and the text

Headline

Therefore after the upgrade all posts that has the old markup of ###Headline are now showing hashmarks instead of the headline font. We have a lot of these. Is there way to clean these up once and for all?


#2

Read this: How to repair old titles? :+1:


(Markus) #4

By the way: There is an additional issue with quotes: The old ones have an empty line between multiple paragraphs without „ > “. In the meantime, most of my posts are rebaked and shows gaps in between. This also looks pretty ugly.

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam cursus augue eu risus iaculis, et vehicula lectus ultricies. Etiam et vulputate purus, vitae sagittis diam. Morbi ornare est metus, nec sagittis velit accumsan in. Aliquam finibus eros mi, id aliquet mi posuere at. Aliquam sagittis risus eu tellus porttitor efficitur. Suspendisse vulputate iaculis mauris, sit amet vulputate turpis congue a. Cras sed leo dolor. Praesent vel tellus est.

Morbi iaculis faucibus turpis ac pulvinar. Etiam vulputate eget lacus aliquet ullamcorper. Nullam efficitur dolor neque, non accumsan ante eleifend in. Nunc sit amet metus id odio ultricies tempus. Nullam eleifend fermentum commodo. Etiam nec sapien felis. Integer nulla orci, placerat sit amet dolor ut, egestas viverra lorem. Etiam suscipit diam a iaculis vulputate. Fusce nec viverra diam. Proin eleifend lorem eget purus auctor, et vulputate nisl dignissim. Sed efficitur purus nec nulla euismod elementum. Aliquam eget libero felis. Duis cursus leo vel ornare accumsan. Morbi congue sollicitudin sem.

But how can we solve this? :thinking:


(Jeff Atwood) #5

None of the things listed here are “broken” this is correct per commonmark spec. See http://commonmark.org


(Sam Saffron) #6

Stop relying on broken quote implementation :hugs:

I

am

a quote

> I 
>
> am
>
> a quote

Magically fixing history with regex is going to end up just creating even more edge cases.


(ljpp) #7

Technically true, but the end users see broken texts and thats the only thing they care about. Most likely none of them has ever heard of CommonMark, nor do they even care to know.


(Markus) #8

That’s exactly the point!

No one want‘s to fix all the issues manually or could do this due limiited time resources. I suggest for future technology changes, that someone also cares about usability, db upgrades and migration. For now, it might be realistic to fix the quote issue by hand. But on the other hand, the titles it would be a giant (/unrealistic) task to fix this.

Imagine the next update will change the way how we emphasize words or create links? Even the most experienced admins won’t have fun with that. In conclusion: I won’t do further updates at all. —> vulnerabilities?!

„Never touch a running system.“ — my parents


(Sam Saffron) #9

I thought I covered this, I also thought about this and cared about this. But…

This is super duper likely :bow_and_arrow: so I picked the lesser of two evils here.

Also see:

Topics tagged markdown-it-review

For a list of bugs that got fixed with the move.


(Jeff Atwood) #10

True, and I also don’t care about those users :wink:

Feel free to educate them how to fix:

##oldway
## new way


(ljpp) #11

Yes, I understand this. @codinghorror comment was such an IT-industry classic that I could not resist in commenting: Works as specified. Billion dollar businesses have collapsed to works as specified.

Back to the point:

Databases are not my strong areas. Would you consider the headline regex fix safe?


(Markus) #12

Discourse Machine Learning :wink:


(Sam Saffron) #13

Depends on the type of content. Cause it is unsafe in some cases.

Eg:

```
#my comment used to be like this in my code block
```

I would consider it probably-ok for your site, testing on your end pending ™


(Jeff Atwood) #14

When you’re a paying customer, I will care about your users. But until you are, I believe that’s your job, sir. Enjoy! :face_with_monocle:


(ljpp) #15

Is there a way to search impacted messages from the web UI? Simply looking for ”###” does not seem to cut it.


(Sam Saffron) #16

The web ui is not the way I would deal with this.

You need to use Postgres regex to find this stuff and replace it in the raw column and then do a rebake.


(ljpp) #17

Yeah, my ideas was to search for the most important / high value articles that have been broken and fixing them manually.