Skip to content

Commit

Permalink
Allow multiple hashtags to start comments at the beginning of a line. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Moderocky committed Dec 30, 2023
1 parent c3b0f44 commit 967f9ee
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
2 changes: 2 additions & 0 deletions src/main/java/ch/njol/skript/config/Node.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,8 @@ public void move(final SectionNode newParent) {
* @return A pair (value, comment).
*/
public static NonNullPair<String, String> splitLine(final String line) {
if (line.trim().startsWith("#"))
return new NonNullPair<>("", line.substring(line.indexOf('#')));
final Matcher m = linePattern.matcher(line);
boolean matches = false;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public void splitLineTest() {
{"ab#cd", "ab", "#cd"},
{"ab##cd", "ab#cd", ""},
{"ab###cd", "ab#", "#cd"},
{"######", "###", ""},
{"#######", "###", "#"},
{"#### # ####", "## ", "# ####"},
{"##### ####", "##", "# ####"},
{"#### #####", "## ##", "#"},
{"#########", "####", "#"},
{"######", "", "######"},
{"#######", "", "#######"},
{"#### # ####", "", "#### # ####"},
{"##### ####", "", "##### ####"},
{"#### #####", "", "#### #####"},
{"#########", "", "#########"},
{"a##b#c##d#e", "a#b", "#c##d#e"},
{" a ## b # c ## d # e ", " a # b ", "# c ## d # e "},
};
Expand Down

0 comments on commit 967f9ee

Please sign in to comment.