-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Markdown syntax check #2495
Comments
someone mentioned https://github.com/MihaZupan/MarkdownValidator |
I have a very basic script that check links in Markdown. I could probably port those to Weblate checks pretty easily. But a more complete solution would be nicer. Here is my script: @matrixcoffee FYI |
Issue #2495 Signed-off-by: Michal Čihař <[email protected]>
Issue #2495 Signed-off-by: Michal Čihař <[email protected]>
It does check whether link references match source. Issue #2495 Signed-off-by: Michal Čihař <[email protected]>
Issue #2495 Signed-off-by: Michal Čihař <[email protected]>
Thank you for your report, the issue you have reported has just been fixed. I've implemented checks which I think make sense (links, link references and inline markup).
|
Issue #2495 Signed-off-by: Michal Čihař <[email protected]>
Hi @nijel, I'm really happy to see this implemented! I'm not really good at reading Python, so can you clarify if these checks cover, for example, missing or extra For example:
|
So far it does check if markup in translation is same as in source. |
Of course! This sounds like an excellent approach :) |
One thing I see a lot in translations is a space between |
Issue #2495 Signed-off-by: Michal Čihař <[email protected]>
It does catch this (just to be sure, I've just added this to the testsuite). |
The other one that I see quite commonly is that translators translate the strings in the URL portion of the Markdown link. That of course breaks the link. That's also in https://gitlab.com/fdroid/fdroid-website/blob/1.72/tools/check-page-links.py Basically, I store all links that are in the source string, then for each link found in the translation string, I check to make sure it is in the list of source string links. |
The hard part with that check is that some sites might want to change all links to force the page to use the localized version, but I haven't seen that case in the stuff I've worked out. |
Currently it doesn't trigger on changed URL, exactly for reason that it might be valid to change them to locale specific in some cases. |
On our site, we almost always use relative links for internal links, then the locale is inherited from the page, and doesn't need to be in the actual link itself. I think this is a relatively common setup for localized websites. And so far, no one has found a localized link for any of the external links that are included. |
With ikiwiki most of the links are locale-agnostic, but the inlines need to be changed (add the locale at the end as .es with Spanish) |
Okay, maybe it makes sense to check relative links for being same. |
Check that relative or page anchors are same. We still do not check external links. Issue #2495 Signed-off-by: Michal Čihař <[email protected]>
Sorry @nijel is this included in last weblate relase? |
What do you mean by "markdown ready"? It can validate markdown syntax in the strings, it can not parse markdown files, see #3106 |
I was asking if is able to work with ".md" files, so you answered my question. |
Is your feature request related to a problem? Please describe.
Many projects use Weblate to edit text files using markdown (and extracted through po4a).
Describe the solution you'd like
Weblate should provide quality check for markdown markup.
Additional context
Example project can be seen at https://hosted.weblate.org/projects/f-droid/website-posts/
Example po file: https://gitlab.com/fdroid/fdroid-website/blob/master/po/_posts.cs.po
The text was updated successfully, but these errors were encountered: