learnlatex / learnlatex.github.io

Learn LaTeX online
https://www.learnlatex.org/
Creative Commons Attribution Share Alike 4.0 International
152 stars 54 forks source link

Italian translation broken link due to failed substitution #215

Closed Atcold closed 2 months ago

Atcold commented 2 months ago

The last paragraph of https://www.learnlatex.org/it/lesson-02 points to a help.md file:

<p>Sarai in grado di <a href="help.md">svolgere tutti gli altri nostri
esercizi direttamente nel tuo browser</a>, ma dato che vogliamo aiutarti
a lavorare con documenti reali, è ora il momento giusto per prepararti.</p>

while all the other languages point to /<language>/help. For example, the English https://www.learnlatex.org/en/lesson-02 has the following paragraph:

<p>You’ll be able to <a href="/en/help">run all of our other exercises
in your browser</a>, but we want to help you get working with real
documents, so now is a great time to get yourself ready.</p>

Therefore, the Italian translation will make the user navigate to the inexistent https://www.learnlatex.org/it/help.md, while the English version will have the correct link https://www.learnlatex.org/en/help.

Looking at the source code for the English version, we can see:

You'll be able to [run all of our other exercises in your browser](help.md),
but we want to help you get working with real documents, so now is a
great time to get yourself ready.

which is consistent with what's done in Italian:

Sarai in grado di [svolgere tutti gli altri nostri esercizi direttamente nel
tuo browser](help.md), ma dato che vogliamo aiutarti a lavorare con
documenti reali, è ora il momento giusto per prepararti.

So, I'm not sure what's going on here. Hence, the lack of a PR from my side.

P.S. Thanks, @davidcarlisle, for putting this project together and answering my questions on StackOverflow. ❤️

davidcarlisle commented 2 months ago

err... that's odd. As you say: the markdown looks correct and the generated html is wrong. I'll see if I can trace what happened..

davidcarlisle commented 2 months ago

the system should drop the .md and link to https://www.learnlatex.org/it/help which seems to work in other languages.

davidcarlisle commented 2 months ago

@Atcold The link now works as I removed the explicit .md from the markdown link (as was already done in the de German version of this page). The .md extension is supposed to get stripped automatically (or more exactly changed to .html which is then droppable) but it wasn't working here.

I may leave this open and try to work out what happened, or I may close if it looks like taking too much time to trace.

davidcarlisle commented 2 months ago

I just added


1 [test1](help.md)

2 [test
 2](help.md)

3 [test
 3](help)

test1 works (and is like en and fr versions)

test2 fails (and matches how the Italian page was, with a line break)

and test 3 works (which matches how the page is now)

So it's an "undocumented feature" of the Jekyll processing that the line break in the link text source affects the processing of the extension in the link path.

I will remove the test links and close this as not our fault :-)

Thanks for the report.

Atcold commented 2 months ago

Wow, it's impressive to follow your mental reasoning process! 🔥 Also, that's why my text editor uses soft-wraps 🥲