mirror of
https://github.com/langchain-ai/langsmith-docs.git
synced 2026-08-27 01:41:19 -04:00
Fix cookbook converter escaping: preserve inline code and correctly convert multiple HTML tables #86
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @0x-Professor on GitHub (Aug 9, 2025).
Summary
The cookbook conversion script currently over-escapes characters outside fenced code blocks but does not respect inline code (single backticks), and the HTML table conversion only handles a single table with limited fidelity. This can corrupt inline code samples and mangle pandas-generated tables in converted content.
Affected code:
replace_bracketsdoes not skip inline code and notes it can break pandas tables.html_table_to_markdownconverts only the first table and loses alignment/formatting.References:
Impact
`a < b`becomesa < b, altering rendered content.Steps to Reproduce
<,>,{,}(e.g.,Use `a < b && c > d` in filters).<table>elements (e.g., with a header table and data table).Proposed Solution
replace_bracketsto detect and skip transformations inside single-backtick code spans (`...`), in addition to fenced code blocks.html_table_to_markdownto:<table>elements within the document.<th align>/<td align>or style attributes and mapping them to Markdown alignment (:---,:---:,---:).<,>,{,}.Acceptance Criteria
Implementation Notes
in_inline_codeflag when encountering backticks not within fenced blocks.in_code_block == falseandin_inline_code == false.<table>, build a Markdown representation; replace the HTML table with Markdown, leaving surrounding content intact.Additional Context
@katmayb commented on GitHub (Nov 18, 2025):
Closing this issue, as we've moved to a new repository and this is not relevant to the new setup. Thank you!