Skip to content

Fix @link matcher #13

Open
Open
@afilina

Description

@afilina
Collaborator

Currently, the @link matcher fails on any value that includes newlines or anything after the URL. Make it more permissive.

Activity

afilina

afilina commented on Mar 29, 2021

@afilina
SponsorCollaboratorAuthor

There are two possible solutions:

  1. If there is anything after the URL, we treat it as the name of the link. So @link https://www.php.net/language.constants.predefined PHP Manual on magic constants will become [PHP Manual on magic constants](https://www.php.net/language.constants.predefined).
  2. We ignore everything after the URL, so @link https://www.php.net/language.constants.predefined PHP Manual on magic constants will become [https://www.php.net/language.constants.predefined](https://www.php.net/language.constants.predefined).

I have a working implementation for option number 1, if we decide to go that route. We'd need to fix two @link tags in PHPCompatibility, which use parentheses. Example: @link https://wiki.php.net/rfc/horizontalreuse (traits)

jrfnl

jrfnl commented on Mar 29, 2021

@jrfnl
Member

Based on the (un)official docs, the first solution would be the correct one. Fixing up those links in PHPCompatibility should be easy enough to do.

Syntax

@link [URI] [description]

Refs:

linked a pull request that will close this issue on Mar 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

    Development

    Participants

    @afilina@jrfnl

    Issue actions

      Fix @link matcher · Issue #13 · PHPCSStandards/phpcs-docs