-
Notifications
You must be signed in to change notification settings - Fork 6
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
mdpo-disable-next-line
and mdpo-enable-next-line
don't just disable the next line
#211
Comments
Sorry, but this is not how md2po works. It's intended to extract text from Markdown content. For this reason the MD4C parser used in the implementation doesn't recognize lines. If you includes another content, it just will not work as you expected. You are using template engine placeholders with HTML and Markdown here, and trying to extract an attribute of HTML. I have to admit that the name of the commands So the solution here would be to add the next aliases for these commands, maintaining the current names for backwards compatibility and convenience:
|
Added I'm open to accept pull requests that implement more flexible ways of parsing than MD4C so we could introduce a real For now I can only suggest to include the whole Jekyll template engine block in POT files. |
Hello,
To ensure proper rendering of images when translated versions are available, we had to put some liquid tricks in place. This, in turn, made it necessary to use
<!-- mdpo-disable-next-line -->
and<!-- mdpo-enable-next-line -->
in our document. However, it seems that instead of just enabling or disabling the next line in the md file, the whole block that mdpo considers a 'message' is enabled or disabled.Given the file gpodder.md (from our Jekyll website):
devices
to be included without whatever follows because it is part of a disabled block (and the same for line 17 with the wordsynchronize
)"devices \" loc=\"/assets/images/documentation\" file=\"gpodder-devices.png\""
" %}{% endcapture %}"
After you created the account
to be included, as it is not excluded by any preceding tags (and the same for line 27 with the phraseAfter you created the devices
)I'm using the following code to create a POT file from the attached MD file:
md2po gpodder.md --po-filepath site-documentation_en.POT --save --quiet --remove-not-found
I'm not sure if this open interpretation is intentional or not. Either way, it would be great if the tags to enable and disable next lines could be interpreted more strictly, so that only any content on the next line in the file is affected - not more not less.
This would save us from having to introduce white lines (which we now need in order to avoid liquid code ending up in our translation files).
Thanks again for making mdpo!
The text was updated successfully, but these errors were encountered: