mirror of
https://github.com/microsoft/markitdown.git
synced 2026-09-28 13:12:58 +08:00
* Fix typos and formatting in comments, docstrings, and markdown files
Comment/docstring typo fixes:
- _base_converter.py: fix 'steam_info' -> 'stream_info', missing 'on',
duplicated 'MUST be reset', 'advances' -> 'advance',
'used to in cases' -> 'used in cases', 'charset, set' -> 'charset, etc.'
- _markitdown.py: 'legaxy' -> 'legacy', 'User' -> 'Use' in DEPRECATED
docstring, second 'PRIORITY_SPECIFIC_FILE_FORMAT (== 10)' ->
'PRIORITY_GENERIC_FILE_FORMAT (== 10)', 'Plugins converters' ->
'Plugin converters'
- __main__.py: 'e.g,' -> 'e.g.,' in --charset help
- _exceptions.py: 'an a single' -> 'a single'
- _docx_converter.py, _epub_converter.py: 'e.g.m headings' ->
'e.g., headings'
- _epub_converter.py: remove stray closing triple-quote in comment
- _outlook_msg_converter.py: 'Brue force' -> 'Brute force'
- _markdownify.py: 'Javascript' -> 'JavaScript'
- _bing_serp_converter.py: remove stray '"' in Base64URL comment
- sample plugin _plugin.py: 'RTF file to in the simplest' ->
'RTF file in the simplest'; 'into an str using hte' ->
'into a str using the'
Markdown formatting fixes:
- README.md: 'Youtube URLs' -> 'YouTube URLs'
- markitdown-mcp/README.md: remove trailing tab characters after
```bash code fences; convert tab-indented JSON array elements to
8-space indentation for consistency
- markitdown-sample-plugin/README.md: 'Next, implement' -> 'First,
implement' for the initial step (no prior step exists); normalize
tab-indented lines inside Python code samples to 4/8-space
indentation; strip trailing spaces
* Fix typos found by codespell in tests and doc intel converter
Test files:
- test_sample_plugin.py: 'dirctly' -> 'directly'
- test_cli_vectors.py: 'readds' -> 'reads'
- test_module_misc.py: 'targted' -> 'targeted' (2 occurrences)
Source files:
- _doc_intel_converter.py: 'availiable' -> 'available' in docstring
Verified clean with:
codespell --skip='.git,test_files,ThirdPartyNotices.md,SECURITY.md,\
SUPPORT.md,CODE_OF_CONDUCT.md,latex_dict.py,omml.py,ocr_test_data,\
*.pdf,*.docx,*.pptx,*.xlsx,*.xls,*.png,*.jpg,*.jpeg,*.wav,*.mp3,\
*.mp4,*.zip,*.epub,*.msg,*.rtf' packages/ README.md
* fix DocumentConverter.PRIORITY_* references
* Quote install commands so they work in zsh; MarkItdown->MarkItDown
In zsh (default macOS shell since 2019, default on many Linux distros),
`[` and `]` are pathname-expansion metacharacters, so `pip install
markitdown[all]` fails with:
zsh: no matches found: markitdown[all]
The top-level README.md already uses the quoted form
(`pip install 'markitdown[all]'`) throughout. This commit brings the
package README and two user-facing dependency-missing error messages
into alignment with that convention, so users copy-pasting from PyPI
or from a raised MissingDependencyException get a command that works
in every mainstream shell.
- packages/markitdown/README.md: quote the PyPI install and the
editable-install-from-source example.
- _exceptions.py: quote the three `pip install` examples inside
MISSING_DEPENDENCY_MESSAGE (shown to end users when an optional
converter dep is missing).
- _transcribe_audio.py: quote the two `pip install` examples in
the raised MissingDependencyException text, and fix a lowercase
'MarkItdown' -> 'MarkItDown' product-name typo in the same string.
Bash/sh/dash treat quoted and unquoted forms identically, so this is
a strict improvement.
Independently proposed by community PRs #1172, #1577, #1602, and #2062
(all still open); fixes referenced issue #1574. Consolidating here to
resolve them in one place alongside the wider prose cleanup.
* Strip trailing whitespace from prose in top-level and package READMEs
Three stray single trailing spaces at end of prose lines:
- README.md (Security Considerations section):
* end of the 'MarkItDown performs I/O...' paragraph
* end of the 'Sanitize your inputs:' paragraph
- packages/markitdown/README.md:
* end of the [!TIP] callout description line
Some Markdown renderers (and Markdown Lint / Prettier / etc.) treat a
trailing double-space as an explicit line break, so accidental single
trailing spaces show up as diff noise on every unrelated edit. They
also make grep/regex line-ends less reliable.
Prose-only change, no rendering impact intended.
Proposed by community PR #1838 (only the whitespace part; that PR
also unrelated changes that blocked it from merging).
* Quote remaining install commands in _cu_converter and _doc_intel_converter
Final-audit pass caught three install-command hints missed by the
earlier commit (cc9202b), which had only picked up the sites listed
in community PR #2062. Same zsh/PowerShell glob-metacharacter bug,
same fix (single-quote the [extras]):
- _cu_converter.py module docstring:
"Install dependencies: ``pip install 'markitdown[az-content-understanding]'``"
- _cu_converter.py MissingDependencyException raised at __init__:
"E.g., `pip install 'markitdown[az-content-understanding]'`"
- _doc_intel_converter.py MissingDependencyException raised at __init__:
"E.g., `pip install 'markitdown[az-doc-intel]'`"
After this commit, no unquoted `pip install ...[extras]` remains
anywhere in READMEs, docstrings, comments, or user-visible error
messages. Consistent with the top-level README convention.
---------
Co-authored-by: afourney <adamfo@microsoft.com>