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

More strict regex #75

Open
EdwinKM opened this issue Apr 4, 2022 · 4 comments
Open

More strict regex #75

EdwinKM opened this issue Apr 4, 2022 · 4 comments

Comments

@EdwinKM
Copy link

EdwinKM commented Apr 4, 2022

The plugin breaks when entering text with multiple plusses. For example, the openssl tool will create lines like:
...................................................................................+++++

We can
fold.txt
improve the regex:

  • Should only start with a "+"
  • Should be exactly be 4 plusses.
  • Newline required after the 4 plusses.

Was toying with something like:
'^+{4}[^+].|(?=.++++$)

But it breaks also. Not sure to part after the pipe (not sure what a "line" is for dokuwiki).
Example file included.

Note: Strict settings can potentially break if users did not exactly followed the syntax.

@atisne
Copy link

atisne commented Sep 8, 2023

The pattern ++ is definitively too common. So many tools use a name containing ++ : C++, Notepad++, bonnie++, tolua++, g++, vera++.
What about using the pattern <++></++> ?
I'm aware that changing the syntax pattern have a big impact on the existing. May the pattern be configurable? At least the number of '+'?

@fiwswe
Copy link
Contributor

fiwswe commented Sep 8, 2023

a) We are dealing with two patterns: inline ++ and block ++++.
b) The patterns also need to take into account the title.
c) Breaking existing pages by changing the patterns is not a good idea. (But you could certainly write a different plugin with similar functionality which uses a different pattern. Or indeed submit a PR to allow configuration of the pattern.)
d) Something++ is only somewhat common in the IT world. And for us nerds it should not be too difficult to simply write %%Something++%% instead. I maintain several (private) wikis with IT content and I have never even noticed this problem.

@ShareBugreports
Copy link

This breaks the plugin also.

++++ block |

sftp://192.168.1.1
++++

@fiwswe
Copy link
Contributor

fiwswe commented Nov 2, 2023

@ShareBugreports This seems like a separate issue to me. I think this may be caused by the DokuWiki automatic URL detection, as the following works fine:

++++ block |

[[sftp://192.168.1.1]]
++++

But I don't have time to analyse this right now.

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

No branches or pull requests

4 participants