You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Markdown backend keeps a whitespace-only first line in code blocks #4541
Follow-up to #4485 / #4487. The Markdown backend trims code block content with lstrip("\n").rstrip(), so a first line that holds only spaces survives: the code item starts with a line of whitespace. #4502 fixed the same case in the LaTeX backend (review suggestion from @DanielNg0729) by dropping leading lines that hold only whitespace.
Steps to reproduce
fromdocling.datamodel.base_modelsimportInputFormatfromdocling.document_converterimportDocumentConvertermd="```\n\n x = 1\n```\n"doc=DocumentConverter().convert_string(md, format=InputFormat.MD).documentprint([t.textfortindoc.textsift.label=="code"])
Activity