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

Allow newline between various tags #2313

Merged
merged 17 commits into from Feb 8, 2018
Merged

Allow newline between various tags #2313

merged 17 commits into from Feb 8, 2018

Conversation

HoutarouOreki
Copy link
Contributor

@HoutarouOreki HoutarouOreki commented Feb 1, 2018

Should fix #268 for color tags.

I'll allow myself a question. How do I put regular expressions in code like this?

$text = str_replace("[i:{$this->uid}]", '<em>', $text);

Never mind, I think I figured it out myself.

Still I'm not really sure what I'm doing, just tried following the patterns. Added a function parseHeading because headings were passed in parseInlineSimple, which I made to pass multiline things, and headings shouldn't be multiline.

Also shouldn't I have renamed the "inline" function, since it now parses multiline? 🙅‍♂️🔫

@HoutarouOreki HoutarouOreki changed the title Allow newline between color tags Allow newline between various tags Feb 1, 2018
@HoutarouOreki
Copy link
Contributor Author

1) BBCodeForDBTest::testAll
Failed asserting that two strings are identical.
--- Expected
+++ Actual
@@ @@
-'[color=white:1]Colored text! (name)[/color:1]
+'[color=white:1]Colored text! (name)[):1]
 
-[color=#ffffff:1]Colored text! (code)[/color:1]
+[color=#ffffff:1]Colored text! (code)[):1]
 
-[color=#FFFFFF:1]Colored text! (uppercased hex)[/color:1]
+[color=#FFFFFF:1]Colored text! (uppercased hex)[):1]
/home/travis/build/ppy/osu-web/tests/Libraries/BBCodeForDBTest.php:37
/home/travis/build/ppy/osu-web/vendor/phpunit/phpunit/phpunit:53
FAILURES!
Tests: 114, Assertions: 275, Failures: 1.

Uhh, I guess for some reason there's ) instead of /color, I'm looking into this.

@peppy peppy added this to the February 2018 milestone Feb 2, 2018
Copy link
Collaborator

@notbakaneko notbakaneko left a comment

Choose a reason for hiding this comment

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

can just use the /s modifier for multi-line matching: /pattern/s

@@ -155,6 +155,17 @@ public function parseInlineSimple($text)
return $text;
}

public function parseHeading($text)

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

@notbakaneko
Copy link
Collaborator

you don't have to merge master every other commit ಠ_ಠ

@HoutarouOreki
Copy link
Contributor Author

🤔

Well GitHub throws a triangle at me with an exclamation mark every time it's "out-of-date" and a big button to update it, so I thought that was the right ting to do.

@notbakaneko notbakaneko merged commit f43f2b1 into ppy:master Feb 8, 2018
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.

BBCode not always working on new website
3 participants