Search found 379 matches

by JoshyPHP
Wed Aug 21, 2013 9:59 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

Today's update: I've added support for the attachment BBCode . Once I made sense of how the current code works, I managed to adapt to it with minimum work. For reference, here's how the legacy routines work: The user posts [аttachment=0]icon_e_biggrin.gif[/attachment] It is stored as [аttachment=0:1...
by JoshyPHP
Wed Aug 21, 2013 3:36 am
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

It determines which default templates are replaced. For instance, the default template for [b] uses <span style="font-weight: bold">. prosilver's template uses <strong>, but since the bit for [b] is not set, it uses the default template instead.
by JoshyPHP
Tue Aug 20, 2013 8:01 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

I assume that styles inherit the whole bbcode.html, not just parts of it right? Do they also inherit the same bbcode_bitfield or can it be different from its parent? Update: pushed to GitHub . I recurse into each style's parents until I find one that has a bbcode.html file. I don't touch the style's...
by JoshyPHP
Tue Aug 20, 2013 4:29 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

I went with the original plan B: query the database, glob all the styles/*/template/bbcode.html files and recompose BBCode templates based on the fragments. The commit is here. The path to styles/ is configurable. This is what the renderer looks like for prosilver+subsilver.
by JoshyPHP
Mon Aug 19, 2013 4:24 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

Actually I do need every bbcode.html file at the same time. All the templates of all the BBCodes of all the styles get cached in the same file.
by JoshyPHP
Sun Aug 18, 2013 9:59 pm
Forum: [3.1/Ascraeus] Merged RFCs
Topic: [RFC] Get rid of JavaScript in HTML code
Replies: 14
Views: 15895

Re: [RFC] Get rid of JavaScript in HTML code

I should correct myself. When I said "Twig can escape new lines in attributes" what I really meant was "Twig can escape attributes" . Does Twig escape new lines? I've checked with the W3 Validator and it seems that new lines are valid in attribute values. As long as quotes get escaped, you're in the...
by JoshyPHP
Sun Aug 18, 2013 9:40 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

I'm a bit stuck wrt styles. What's the best way to get a list of all styles? Should I just query the database like style_select() does? And once I have the list of styles, what's the easiest way to get the bbcode.html of each style? I thought that reusing the code from bbcode::bbcode_cache_init() wo...
by JoshyPHP
Sat Aug 17, 2013 9:48 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

It doesn't create any HTML file. In short, it goes like this: <special custom BBCode syntax like phpBB's admin panel> :arrow: XSLT :arrow: <internal representation> :arrow: PHP. And here's a near-complete rundown. In phpBB land, phpbb_textformatter_s9e_factory::get_configurator() creates an instance...
by JoshyPHP
Sat Aug 17, 2013 7:23 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

My plan right now is to capture all the template fragments from bbcode.html and recompose each BBCode's template using the same syntax as custom BBCodes. For instance, for the BBCode i : i_open + {TEXT} + i_close = <em>{TEXT}</em> . After this, it's exactly the same as a custom BBCode entered in the...
by JoshyPHP
Sat Aug 17, 2013 1:47 pm
Forum: [3.2/Rhea] Merged RFCs
Topic: [RFC] Integrate s9e\TextFormatter
Replies: 168
Views: 249929

Re: [RFC] Integrate s9e\TextFormatter

Wrong. The bitfield marks which BBCodes were used in that text out of all the predefined ones. You're talking about a different thing. If you look into bbcode::bbcode_cache_init() and bbcode::bbcode_tpl() you can see how $this->template_bitfield is being used. You might want to use the template eng...