google / mdbook-i18n-helpers

Translation support for mdbook. The plugins here give you a structured way to maintain a translated book.
Apache License 2.0
126 stars 25 forks source link

Fix codeblock in codeblock #129

Closed dalance closed 8 months ago

dalance commented 8 months ago

Codeblock which contains ``` will be like below:

````markdown
```rust
let a = 0;

But the output of mdbook-i18n-helpers seems to be broken like below:

```markdown
```rust
let a = 0;

This is because codeblock token count is fixed as 3 in reconstruct_markdown. This PR adds to check the appropriate codeblock token count.

mgeisler commented 8 months ago

Thanks @dalance for finding and fixing this! I believe the correct place to fix this would actually be in pulldown-cmark-to-cmark. I went looking there and https://github.com/Byron/pulldown-cmark-to-cmark/issues/20 looks related.

I'm happy to fix this here for now, but we should add a TODO comment with a reference to pulldown-cmark-to-cmark to see if we can fix it for everybody.

dalance commented 8 months ago

@mgeisler Thank you for merging this PR. Could you release 0.3.1 including this? (Or is there any release plan?)

This is because the problem is a blocking issue of translation on https://github.com/rust-lang/rust-by-example.

mgeisler commented 7 months ago

@mgeisler Thank you for merging this PR. Could you release 0.3.1 including this? (Or is there any release plan?)

This is because the problem is a blocking issue of translation on https://github.com/rust-lang/rust-by-example.

Thanks for reminding me of this! Let me create a release now!

mgeisler commented 7 months ago

I've made a 0.3.1 release! :tada: