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

Fix matchInContainer false positives #1605

Merged
merged 4 commits into from
Jul 9, 2021
Merged

Fix matchInContainer false positives #1605

merged 4 commits into from
Jul 9, 2021

Conversation

tamo
Copy link
Contributor

@tamo tamo commented Sep 25, 2020

The function should match only the beginnings of lines.

For example, see this testcase:

:::spoiler
here is a :::
:::
:::

The last line should be completed, and the third should not.

Without this patch, the third line is completed and the last is not.

FYI, this patch is not perfect, either.
If the third line is ":::bogus", the parser won't treat it as the closer. But matchInContainer will.
So the right regexp would be /(^|\n):::\s*(success|info|warning|danger|spoiler)($|\s)/ but who cares

The function should match only the beginnings of lines.

For example, see this testcase:
```
:::spoiler
here is a :::
:::
:::
```
The last line should be completed.

Without this patch, the third line is completed and the last is not.

Signed-off-by: Tamotsu Takahashi <[email protected]>
@Yukaii Yukaii temporarily deployed to codimd-patch-1-jn9dwdmrqs0wfkl September 29, 2020 06:08 Inactive
@Yukaii Yukaii temporarily deployed to codimd-patch-1-0us6xicrsdcdsp6 May 11, 2021 07:14 Inactive
public/js/index.js Outdated Show resolved Hide resolved
simplify the regex
suggested by yukaii in #1605

Co-authored-by: Yukai Huang <[email protected]>
@Yukaii Yukaii temporarily deployed to codimd-patch-1-0us6xicrsdcdsp6 May 12, 2021 00:22 Inactive
@Yukaii
Copy link
Member

Yukaii commented May 12, 2021

@tamo Commit 4002306 needs to be signed off to make DCO check passed. 👍

@jackycute jackycute added this to the Next milestone May 12, 2021
tamo and others added 2 commits May 13, 2021 11:41
simplify the regex
suggested by yukaii in #1605

Co-authored-by: Yukai Huang <[email protected]>
Signed-off-by: Tamotsu Takahashi <[email protected]>
Copy link
Member

@jackycute jackycute left a comment

Choose a reason for hiding this comment

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

LGTM

@jackycute jackycute merged commit 4b78202 into hackmdio:develop Jul 9, 2021
jakubgs pushed a commit to status-im/codimd that referenced this pull request Aug 23, 2021
simplify the regex
suggested by yukaii in hackmdio#1605

Co-authored-by: Yukai Huang <[email protected]>
Signed-off-by: Tamotsu Takahashi <[email protected]>
edgarogh pushed a commit to WartaPoirier-corp/codimd that referenced this pull request Sep 21, 2021
@a60814billy a60814billy mentioned this pull request Jan 18, 2022
@Yukaii Yukaii modified the milestones: Next, 2.5.0 Dec 26, 2023
@stanley2058 stanley2058 mentioned this pull request Dec 26, 2023
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