rustdoc: Revert "fix bare urls split text" - #162779
Conversation
This reverts commit d4e6b8f. Reverted commit contains incorrect comments, does not implement all the functionality it claims to, and lacks test coverage.
|
It was merged in #162381. cc @notriddle so you're aware of this. Thanks for noticing this issue @lolbinarycat ! |
|
r=me once CI pass |
Which comments? This one? That comment is true.Given the URL from the test case, we can see it happen with the pulldown-cmark CLI. That's why the lint emits a bad suggestion in #162345 $ git clone https://github.com/pulldown-cmark/pulldown-cmark.git
$ cd pulldown-cmark
$ cargo run --release -- --events
https://en.wikipedia.org/wiki/Rust_(programming_language)
^D
0..58: Start(Paragraph)
0..34: Text(Borrowed("https://en.wikipedia.org/wiki/Rust"))
34..35: Text(Borrowed("_"))
35..57: Text(Borrowed("(programming_language)"))
0..58: End(Paragraph)
EOFOr are you talking about this one? That one is a bit confusing. The parens are balanced, since the regex won't match a lone paren, but they can't be nested, because regex can't represent recursive grammars. It does, indeed, correctly handle a trailing
I knew that the improved regex only handled a single pair of nested parens. I also know that multiple levels of nesting are rare, and Wikipedia article URLs are common. |
|
In any case, if you would prefer a version of this code that handles nested parens, I can write it. I'll also add more test cases. |
|
@bors r=GuillaumeGomez,notriddle Sorry about closing the PR. Wrong button. |
… r=GuillaumeGomez,notriddle rustdoc: Revert "fix bare urls split text" This reverts commit d4e6b8f. Reverted commit contains incorrect comments, does not implement all the functionality it claims to, and lacks test coverage. If someone wishes to re-add the functionality, it should be done as postprocessing after the regex match, as regex is not capable of handling arbitrary nesting of matched pairs. Additionally, future PRs attempting to reinstate this should frame it as a change to a fuzzy heuristic, not as a simple "fix". r? @GuillaumeGomez
Rollup of 7 pull requests Successful merges: - #160911 (Remove d32 feature from 32-bit Arm targets) - #162771 (Filter do_not_recommend impls before handling a single candidate) - #162779 (rustdoc: Revert "fix bare urls split text") - #161612 (std: make a lot of items crate private) - #162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - #162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - #162784 (AGENTS.md: Permit local experimentation, per the online policy.)
… r=GuillaumeGomez,notriddle rustdoc: Revert "fix bare urls split text" This reverts commit d4e6b8f. Reverted commit contains incorrect comments, does not implement all the functionality it claims to, and lacks test coverage. If someone wishes to re-add the functionality, it should be done as postprocessing after the regex match, as regex is not capable of handling arbitrary nesting of matched pairs. Additionally, future PRs attempting to reinstate this should frame it as a change to a fuzzy heuristic, not as a simple "fix". r? @GuillaumeGomez
Rollup of 10 pull requests Successful merges: - #160911 (Remove d32 feature from 32-bit Arm targets) - #162771 (Filter do_not_recommend impls before handling a single candidate) - #162779 (rustdoc: Revert "fix bare urls split text") - #161548 (hir_typeck: Don't ICE on closures without drop location in closure capture lint) - #161612 (std: make a lot of items crate private) - #162204 (Suggest keyword order for `extern "C" const unsafe fn`) - #162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - #162638 (dont suggest changing the mutability of a borrow that comes from a macro) - #162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - #162784 (AGENTS.md: Permit local experimentation, per the online policy.)
Rollup of 10 pull requests Successful merges: - #160911 (Remove d32 feature from 32-bit Arm targets) - #162771 (Filter do_not_recommend impls before handling a single candidate) - #162779 (rustdoc: Revert "fix bare urls split text") - #161548 (hir_typeck: Don't ICE on closures without drop location in closure capture lint) - #161612 (std: make a lot of items crate private) - #162204 (Suggest keyword order for `extern "C" const unsafe fn`) - #162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - #162638 (dont suggest changing the mutability of a borrow that comes from a macro) - #162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - #162784 (AGENTS.md: Permit local experimentation, per the online policy.)
…uwer Rollup of 12 pull requests Successful merges: - #160911 (Remove d32 feature from 32-bit Arm targets) - #161868 (libtest: never iterate over all tests in `--exact` mode) - #162771 (Filter do_not_recommend impls before handling a single candidate) - #162779 (rustdoc: Revert "fix bare urls split text") - #161548 (hir_typeck: Don't ICE on closures without drop location in closure capture lint) - #161612 (std: make a lot of items crate private) - #162204 (Suggest keyword order for `extern "C" const unsafe fn`) - #162372 (Clean up `test/rustdoc-html` folder by moving tests where appropriate) - #162638 (dont suggest changing the mutability of a borrow that comes from a macro) - #162643 (Fix `path_trailing_sep` methods for Windows verbatim paths) - #162654 (Improve Armv7-R documentation) - #162784 (AGENTS.md: Permit local experimentation, per the online policy.)
Personally I'd love to. Although not sure if regex is the right path for this. In any case, I trust your judgement, can't wait to see the improved version. =D |
Rollup merge of #162779 - lolbinarycat:rustdoc-revert-regex, r=GuillaumeGomez,notriddle rustdoc: Revert "fix bare urls split text" This reverts commit d4e6b8f. Reverted commit contains incorrect comments, does not implement all the functionality it claims to, and lacks test coverage. If someone wishes to re-add the functionality, it should be done as postprocessing after the regex match, as regex is not capable of handling arbitrary nesting of matched pairs. Additionally, future PRs attempting to reinstate this should frame it as a change to a fuzzy heuristic, not as a simple "fix". r? @GuillaumeGomez
This reverts commit d4e6b8f.
Reverted commit contains incorrect comments,
does not implement all the functionality it claims to, and lacks test coverage.
If someone wishes to re-add the functionality, it should be done as postprocessing after the regex match, as regex is not capable of handling arbitrary nesting of matched pairs. Additionally, future PRs attempting to reinstate this should frame it as a change to a fuzzy heuristic, not as a simple "fix".
r? @GuillaumeGomez