mozilla / bedrock

Making mozilla.org awesome, one pebble at a time
https://www.mozilla.org
Mozilla Public License 2.0
1.18k stars 919 forks source link

Privacy notice for Klar is incomplete #10850

Closed flodolo closed 2 years ago

flodolo commented 2 years ago

Klar used to have a separate file for German, but they were unified recently in a single file.

https://www.mozilla.org/de/privacy/firefox-klar/

This shows the right title, but:

See the original source doc https://github.com/mozilla/legal-docs/blob/master/de/focus_privacy_notice.md

flodolo commented 2 years ago

I compared the file for de and other locales, and couldn't spot anything strange. I wonder if there's code that treats German in a different way for that specific file.

One other thing is that this seems to be the only date that starts with xx., all the other files either have the name of the day, or a sentence ("gültig ab")

alexgibson commented 2 years ago

I took a look at this locally and I think I might have figured out what's happening. Because the file is markdown, the date formatting is being interpreted as a list item:

14. Oktober 2021

Resolves to

<li datetime="2021-10-14">Oktober 2021</li>

This then also messes up the lead-in paragraph, because the next sibling is assumed to be a paragraph, but it's actually the list parent.

Is it possible to try escaping the period?

14\. Oktober 2021

flodolo commented 2 years ago

Is it possible to try escaping the period?

Absolutely, done in https://github.com/mozilla/legal-docs/commit/3507636a0bd6296640b9abcfe70ed8ec4fec92b2 (and noticed there's at least another doc where that's done)

flodolo commented 2 years ago

Thanks, that worked https://www-dev.allizom.org/de/privacy/firefox-klar/

I wonder if there's a way to make the parser deal in a more robust way with this? With that said, if it happens again, at least we know.

alexgibson commented 2 years ago

I wonder if there's a way to make the parser deal in a more robust way with this? With that said, if it happens again, at least we know.

I'm not really sure here. The parser is working in that it's interpreting markdown correctly. But I'm not sure we can easily tell between an intentional list and an unintentional one, if they are both formatted in the same way.

But at least for now, we have figured out the issue and solved it in this case. I'm going to close this for now, but we can always try and figure something better out if it catches us again.

Thanks @flodolo!