fix(xlsx): render float values faithfully instead of 6-digit scientific notation - #2533
Open
Manohar Paturi (ManoharPaturi) wants to merge 3 commits into
Open
Manohar Paturi (ManoharPaturi) wants to merge 3 commits into
Manohar Paturi (ManoharPaturi) wants to merge 3 commits into
Conversation
MarkItDown._convert applied its whitespace cleanup (rstrip every line, collapse 3+ newlines to 2) to the entire converted document, which corrupted fenced code blocks: blank-line runs inside a fence collapsed and trailing spaces were stripped, changing code content. Track code fences while normalizing and leave their contents untouched. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
mammoth's default style map stops at Heading 6, so Word's deeper heading styles came through as plain paragraphs and their structure was dropped. Add style-map entries mapping Heading 7/8/9 to h6, the deepest level markdown supports. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
pandas to_html's default float format silently drops entered digits (123456789.123 -> 1.234568e+08). Pass float_format so the shortest round-tripping representation of the stored value is used. Applies to both the .xlsx and .xls paths. Signed-off-by: Manohar Paturi <186662190+ManoharPaturi@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2532.
Passes
float_formatto bothto_htmlcall sites so a float renders as the shortest string that round-trips its stored value instead of pandas' 6-significant-digit scientific notation. Integral columns keep rendering through the existing paths (the integer formatting from #2485-style handling is untouched;42.0in a genuinely-float column renders as42.0).Regression test asserts
123456789.123survives and1.234568e+08does not appear (fails on main). Existing xlsx/xls suites green (27 passed).