mdbook-typst icon indicating copy to clipboard operation
mdbook-typst copied to clipboard

Error when title follow a quote

Open cittadhammo opened this issue 1 year ago • 3 comments

I have spotted an error when you have a title after a quote in your md file. For example:

# Chapter 1

testing

# Chapter 2

a quote below

> this is a quote

# Chapter 3

testing again.

Will be transformed into typst file:

= Chapter 1
#par()[testing ]
== Chapter 2
#par()[a quote below]
#quote(block: true, quotes: auto,)[#par()[this is a quote]
]== Chapter 3
#par()[testing again.]
#pagebreak(weak: true)
#pagebreak(weak: true)

The error appears at chapter 3, there should not be that extra ]

cittadhammo avatar Sep 23 '24 20:09 cittadhammo

Just noticed that the heading levels are not respected as well ! ;-)

cittadhammo avatar Sep 23 '24 20:09 cittadhammo

I see the problem:

=== Section 1
#par()[Test]
#align(center, line(length: 60%))
#par()[This is a quote below with other text below]
#quote(block: true, quotes: auto,)[#par()[A nice quote my firend]
]#par()[And another line that is not a quote]
=== Section 2
#par()[Test with a quote below: ]
#quote(block: true, quotes: auto,)[#par()[this is a quote]
]== Chapter 2
#par()[Test] 
#align(center, line(length: 60%))
#par()[Test]
#pagebreak(weak: true)
#pagebreak(weak: true)

The quote bracket doesn't close the line properly, but only appear on the next line. This creates a problem if there is a title following...

cittadhammo avatar Sep 24 '24 15:09 cittadhammo

Just noticed that the heading levels are not respected as well ! ;-)

It seems that this error comes from having two first level heading in a single markdown file. This seems to contradict the mdbook structure. So I won't attend to fix it ;-)

cittadhammo avatar Sep 24 '24 15:09 cittadhammo

This should be fixed in v0.1.7. Let me know if it is not!

LegNeato avatar Oct 29 '24 02:10 LegNeato