Skip to main content
Topic: BBC Parsing (Read 39984 times) previous topic - next topic
0 Members and 4 Guests are viewing this topic.

Re: BBC Parsing

Reply #150

As I mentioned, though, the attach id is available only if we rely on javascript, or if we replace the tag after the post is made...
Bugs creator.
Features destroyer.
Template killer.

Re: BBC Parsing

Reply #151

Yeah, let's do that.

Re: BBC Parsing

Reply #152

Argh... even more work before ILA is ready for beta! :'(
Bugs creator.
Features destroyer.
Template killer.

Re: BBC Parsing

Reply #153

LOL I was thinking the same thing !  But a change like that would have to be in B1 for sure.

Re: BBC Parsing

Reply #154

It makes more sense than adding a message id to the BBC parser.

Re: BBC Parsing

Reply #155

When closing tags get done out of order, the parser silently fixes them. Should the preparser do this?

Example:
Code: [Select]
[b][i]test[/b][/i]

Result:
test[/i]

The parser silently changes that to:
Code: [Select]
[b][i]test[/b][/i]

Just wondering if the preparser should do that. Maybe even remove the extraneous closing i (can't do the tag because I just found a bug)

Re: BBC Parsing

Reply #156

Weird. When I pressed save, this is what it did.
Code: [Select]
When closing tags get done out of order, the parser silently fixes them. Should the preparser do this?

Example:
[*code][b][i]test[/b][i][/*code]
[i]
[i]

Result:
[b][i]test[/i][/b]

The parser silently changes that to:[/i]
[/i][*code][b][i]test[/i][/b][/*code]
[i]


Just wondering if the preparser should do that. Maybe even remove the extraneous closing [/i]

Re: BBC Parsing

Reply #157

Must be the preparser or editor playing around with the tags.

 I know the preparser already does a large host of fixing (tables, fonts, lists, quotes, empty tags, etc) so to answer the question I would think the fixing should be part of that code so its done once.  

Should at some point consider renaming it from preparsecode to preparse_bbc since it does a lot more than code stuff.

Re: BBC Parsing

Reply #158

The class I'm using locally is named \BBC\Preparser and the main method is parse(). It's a radically different preparser that is taking a lot of thinking to get right.

Re: BBC Parsing

Reply #159

After installing a white page with this error message appears:
Fatal error: Class 'BBC\Autolink' not found in C:\xampp\htdocs\elk11\sources\subs\BBC\ParserWrapper.php on line 380

Issues #2305



Regards Stephan

Re: BBC Parsing

Reply #160

Now that I'm working on the preparser and I have commits for Elkarte, I want to track the changes all the way through the lifecycle and ensure that tests are working from repo to repo. I am moving the messages to a directory called "Messages." That directory contains a class per file which is of the MessageInterface type.

Each class has 4 methods: input, stored, output, and name. Name is just to get a human readable format of it. The input is what you expect to receive from the user when they are posting. This gets sent to the preparser. Stored is what it gets stored as and is the result of the preparser. It is also the input to the parser. Output is the expected result of the parser.

There are a lot of messages which means a lot of tests. I don't have time to convert all of the messages from Messages.php and PreparseMessages.php to classes. If there is someone that wants to help with this, this is a really easy way to get involved in helping Elkarte and learn more about PHP.

If you are interested, feel free to fork the BBC-Parser repo, take a look at the most recent commit and dive in. You can submit pull requests or just create a zip file and upload it here. Feel free to add a comment at the top of the file giving yourself credit.

The structure to read the files hasn't been created yet. It will simply read the directories and create the classes as it needs.

Re: BBC Parsing

Reply #161

That's one for @emanuele. Looks like an autoloader issue.


Re: BBC Parsing

Reply #163

https://github.com/joshuaadickerson/BBC-Parser/commit/897ac719bed289ba7aa6a70938028c59c4397521
https://github.com/joshuaadickerson/BBC-Parser/commit/31ed7754154a7bd454b1c1caf720f0c4c9d809f5

The first one is the script to run to create the test message files. The second is the actual files. Feel free to take part in the process. All that's needed is to break them down in to directories (with their namespace) and name them accordingly.

Re: BBC Parsing

Reply #164

Looks like the output lines are the same as the input?  Are those supposed to be the html output from the parser instead?