Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip generating md links in 'pre' blocks #322

Merged
merged 1 commit into from
Feb 11, 2025
Merged

Conversation

t-kalinowski
Copy link
Contributor

Markdown does not support links in pre-formatted code blocks.

With the current release, markitdown mangles code chunks by generating links.

For example: markitdown https://r4ds.hadley.nz/base-r will generate code chunks that look like this:

```
# Left
[hist](https://rdrr.io/r/graphics/hist.html)(diamonds$carat)

# Right
[plot](https://rdrr.io/r/graphics/plot.default.html)(diamonds$carat, diamonds$price)
```

With this patch, the same code chunk is now correctly generated

```
# Left
hist(diamonds$carat)

# Right
plot(diamonds$carat, diamonds$price)
```

@afourney
Copy link
Member

Nice find. Thanks for the PR.

We should add a test for this to avoid regressing. But it's simple enough that we can add tests in another PR.

@afourney afourney merged commit 3a5ca22 into microsoft:main Feb 11, 2025
3 checks passed
t-kalinowski added a commit to t-kalinowski/ragnar that referenced this pull request Feb 16, 2025
- contains fix for `pre` microsoft/markitdown#322
- DocumentConverterResult moved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants