Skip to content
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

Output unknown template as-is #1500

Closed
BoboTiG opened this issue Jan 6, 2023 · 6 comments · Fixed by #1519
Closed

Output unknown template as-is #1500

BoboTiG opened this issue Jan 6, 2023 · 6 comments · Fixed by #1519
Labels
bug Something isn't working

Comments

@BoboTiG
Copy link
Owner

BoboTiG commented Jan 6, 2023

Wikicode:

{{[[re-]]}}

Output:

<i>(Re-)</i>

Expected:

{{re-}}

Should we try to extract [[re-]] from the {{}} in clean()? 🤔

@BoboTiG BoboTiG added the bug Something isn't working label Jan 6, 2023
@BoboTiG BoboTiG changed the title [FR] What do with such template? Extract linked terms from braces to prevent renderting them Jan 6, 2023
@BoboTiG BoboTiG changed the title Extract linked terms from braces to prevent renderting them Extract linked terms from braces Jan 6, 2023
@lasconic
Copy link
Collaborator

lasconic commented Jan 6, 2023

I would say the last last template handler should deal with it and not output <i>(Whatever)</i> but instead {{whatever}} ?

Do we really need this default output with <i>()</i> ?

@BoboTiG
Copy link
Owner Author

BoboTiG commented Jan 6, 2023

I guess the default formatting was useful at some point. We can try without and see what breaks.

@lasconic
Copy link
Collaborator

lasconic commented Jan 8, 2023

It's not that easy :) returning {{templatename}} in the default handler will cause an infinite loop, since we will always find a template to process...

@BoboTiG
Copy link
Owner Author

BoboTiG commented Jan 16, 2023

Yeah, and that's a corner case.
I do not get the formatting on the Wiktionary, is it a special meaning to use {{xxx}} in the French language? Maybe would it be good enough to edit the Wikicode.
I'm running --check-words a lot, and so far it's the only case I found.

@lasconic
Copy link
Collaborator

I found a (ugly) solution for the infinite loop but running check-words show that there are some templates that we don't handle (plus rare for example) that are handled by the default case...
I believe {{xxx}} just works on wiktionary and the editor wanted a way to not use [].

@BoboTiG
Copy link
Owner Author

BoboTiG commented Jan 16, 2023

Let's go for the ugly solution then :)

@lasconic lasconic changed the title Extract linked terms from braces Output unknown template as it Jan 17, 2023
lasconic added a commit to lasconic/ebook-reader-dict that referenced this issue Jan 17, 2023
@BoboTiG BoboTiG changed the title Output unknown template as it Output unknown template as-is Jan 17, 2023
lasconic added a commit that referenced this issue Jan 17, 2023
Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants