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

Text is not extracted from links #405

Open
Unrud opened this issue Dec 13, 2021 · 0 comments
Open

Text is not extracted from links #405

Unrud opened this issue Dec 13, 2021 · 0 comments
Labels
bug Something isn't working

Comments

@Unrud
Copy link

Unrud commented Dec 13, 2021

Description

Text is not extracted from links.

Environment

MDL Version
v0.11.0 and master

Expected Behavior

> <http://example.org> more text.

The example above doesn't violate the rule MD027 - Multiple spaces after blockquote symbol.

Actual Behavior

markdownlint thinks the example violates MD027.

Text from links is ignored:

markdownlint/lib/mdl/doc.rb

Lines 255 to 263 in 0b006db

lines = element.children.map do |e|
if e.type == :text
e.value
elsif %i{strong em p codespan}.include?(e.type)
extract_text(e, prefix, restore_whitespace).join("\n")
elsif e.type == :smart_quote
quotes[e.value]
end
end.join.split("\n")

Just adding a to the list solves the problem for MD027 but causes issues with other rules because they rely on text from links being ignored (?).

@Unrud Unrud added the bug Something isn't working label Dec 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant