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

MD027: handle anchor elements correctly #463

Merged
merged 1 commit into from
Sep 6, 2023

Conversation

marquiz
Copy link
Contributor

@marquiz marquiz commented Aug 3, 2023

Description

Fixex false positives of MD027 multiple-spaces-after-blockquote-symbol if quote lines begin with a link, e.g.

> This is a
> [link](link) to somewhere

Related Issues

Types of changes

  • [ x Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (non-breaking change that does not add functionality but updates documentation)
  • Chore (non-breaking change that does not add functionality or fix an issue)

Checklist:

  • I have read the CONTRIBUTING document.
  • Wrote good commit messages
  • Feature branch is up-to-date with master, if not - rebase it
  • Added tests for all new/changed functionality, including tests for positive and negative scenarios
  • The PR relates to only one subject with a clear title and description in grammatically correct, complete sentences

Copy link
Member

@jaymzh jaymzh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, thanks!

@jaymzh
Copy link
Member

jaymzh commented Aug 3, 2023

Looks like there's some tests failing @marquiz

Fixex false positives of MD027 multiple-spaces-after-blockquote-symbol
if quote lines begin with a link, e.g.

  > This is a
  > [link](link) to somewhere

Signed-off-by: Markus Lehtonen <markus.lehtonen@intel.com>
@marquiz marquiz changed the title lib/mdl/doc: handle anchor elements in extract_text MD027: handle anchor elements correctly Aug 4, 2023
@marquiz
Copy link
Contributor Author

marquiz commented Aug 4, 2023

Looks like there's some tests failing @marquiz

Argh, looks like I somehow messed up running tests locally.

In order to fix that I now specified a new doc.extract_as_text function in order to not break MD036 :/ I'm not much of an expert on ruby or this codebase so suggestions how to fix this in nicer way are welcome (tbh, this whole extract_text business looks flaky and fragile and not so well-defined).

I also changed the commit message title (and the title of this PR, accordingly).

@jaymzh jaymzh merged commit 3d760ba into markdownlint:main Sep 6, 2023
@marquiz marquiz deleted the devel/md027 branch September 7, 2023 04:22
@danie1k
Copy link

danie1k commented Oct 30, 2023

@marquiz & @jaymzh, sadly there is still something broken IMHO.
For example:

raises M027:

> lorem
> -- ipsum

not raises M027:

> lorem
> --ipsum

not raises M027:

> lorem
> - ipsum

In general, it looks like false-positive when there is two or more dashes.

@jaymzh
Copy link
Member

jaymzh commented Oct 30, 2023

That's a different (but related) bug, @danie1k. Can you please file a separate issue?

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.

None yet

3 participants