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

Issues with "New Lines" #1

Open
gilbertorconde opened this issue Apr 8, 2016 · 4 comments
Open

Issues with "New Lines" #1

gilbertorconde opened this issue Apr 8, 2016 · 4 comments
Assignees
Labels

Comments

@gilbertorconde
Copy link

I do not know why (didn't studied your code), had some problems when the content had newlines "\n". To fix it changed the "process" function to:
public function process()
{
$args = func_get_args();
$text = array_shift($args);
$text = trim(preg_replace('/\s+/', ' ', $text)); // Added this line to this function
while(true) {
$sc = $this->getShortCodes($text);
if (empty($sc)) {
break;
}
$text = $this->processCodes($text, $sc, $args);
}
return $text;
}
As i said, i didn't studie your code, so this is not the best solution. (btw, I used your plugin with tinymce.)

@lfkeitel
Copy link
Member

lfkeitel commented Apr 8, 2016

So the issue was when a new line was between an opening and a closing shortcode or when the entire text has newlines?

@gilbertorconde
Copy link
Author

Actually i dont know. I did not test it. Once I realized I could be '\n' issue I tested this line ($text = trim(preg_replace('/\s+/', ' ', $text));) and solved my problem. By having line break, it automatically shut the tag early. But it seems to be an easy thing to test.

@gilbertorconde
Copy link
Author

I've done some tests and, apparently, is just with new lines inside the shortecode tags.

@lfkeitel
Copy link
Member

Alright, I'll take a look at it and get a fix out as soon as I can. Thanks for letting me know!

@lfkeitel lfkeitel added the bug label Apr 12, 2016
@lfkeitel lfkeitel self-assigned this Apr 12, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants