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

Where is the js BBCode tag parser #6

Closed
brunoais opened this issue Mar 9, 2015 · 6 comments
Closed

Where is the js BBCode tag parser #6

brunoais opened this issue Mar 9, 2015 · 6 comments

Comments

@brunoais
Copy link

brunoais commented Mar 9, 2015

Can you please take me to where the BBCode tag parser for the javascript part is?
I'm interested in the parts that parse each specific tag according to its settings and restrictions, not the part that deals with the actual HTML output building, just where it processes the restrictions and decides the actual transformations to use.

@JoshyPHP
Copy link
Member

JoshyPHP commented Mar 9, 2015

The BBCodes parser is in src/Plugins/BBCodes/Parser.js. It's a port of Parser.php in the same directory.

Tag rules are applied by the main parser in processStartTag().

@brunoais brunoais closed this as completed Mar 9, 2015
@brunoais brunoais reopened this Mar 9, 2015
@brunoais
Copy link
Author

brunoais commented Mar 9, 2015

Although I could get a lot of content from there... I couldn't get how do you deal with BBCode that follows more interesting approaches such as 1 param into 2 params or 2 params into 1 param like you describe in the CodeMonkey documentation. Where is the js code to do that?

@JoshyPHP
Copy link
Member

JoshyPHP commented Mar 9, 2015

They're attribute preprocessors and they're handled in s9e\TextFormatter\Parser::executeAttributePreprocessors() or the equivalent JS function. It's an internal data structure though and as such it's subject to change without warning. You should generally not mess with them.

@brunoais
Copy link
Author

brunoais commented Mar 9, 2015

I just want to get the Regex processing you use to get it up and working ^^. That should do it.

@JoshyPHP
Copy link
Member

JoshyPHP commented Mar 9, 2015

All the processing is done in executeAttributePreprocessors() but there's no public API for it. Not sure what you're looking for exactly, what are you trying to do?

@JoshyPHP JoshyPHP closed this as completed Mar 9, 2015
@JoshyPHP JoshyPHP reopened this Mar 9, 2015
@brunoais
Copy link
Author

brunoais commented Mar 9, 2015

Ah! Found something here:
TextFormatter/src/Parser/BuiltInFilters.js
This is part of what I wanted. The rest should be in the other answer.

I'm after the adaptations required to make a WYSIWYG editor on a client which uses TextFormatter on the server, for phpBB.

@brunoais brunoais closed this as completed Mar 9, 2015
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

2 participants