chriskonnertz / bbcode Goto Github PK
View Code? Open in Web Editor NEWA BBCode parser and converter written in PHP.
License: MIT License
A BBCode parser and converter written in PHP.
License: MIT License
When doing an image tag without width or height, it works fine. But with either one or both(to allow custom image sizes), it seems to not like it, could this be added?
Hi, is there a way to customise how \r\n\r\n
characters are converted?
I'm looking to have \r\n\r\n
become </p>\n\n<p>
(wrapped in paragraph tags, first tag is last tag of previous paragraph for this example sequence).
Currently this package is producing <br/>\n<br/>\n
and no paragraphs at all.
Even if I was able to turn-off the automatic <br>
insertion and do it outside of this package, that would be ok.
Currently, only the following syntax is valid:
[youtube]04FOUQpnGsc[/youtube]
It would be great if this could be accepted as alternative syntax:
[youtube=04FOUQpnGsc]
(The email-tag has a similar ability to have 2 possible syntaxes)
[list]
[*] Reduced enemy count in Furies Wings
...
will be converted to
<ul><br/>
</li><li> Reduced enemy count in Furies Wings<br/>
...
The line break after the <ul>
is in a <li>
tag which never was opened.
My proposal is to add something like "allowedChildTags" to the Tag class, so that after opening a list only [*]
[li]
is allowed. No idea what to if that is not the case. The keepLines behaviour needs also to be adapted.
Hi,
There's the $html
variable, but this doesn't return quite what I was hoping for.
Example [html]<span>blah blah</span>[/html]
For a custom tag, I'd like to be able to get the <span>blah blah</span>
content only, is that possible?
$bbcode->addTag('newhtml', function($tag, &$html, $openingTag) {
// I'd like to do something with the internal content of the tags here
});
Currently it doesn't look possible to overwrite any existing tags, to customise them?
Hi,
I want to use your bbcode-parser to parse text from a database. In some of the entries there is a HTML script-tag with javascript to show ads.
But when the parser does his 'trick', the content between the script-tags disappears and is replaced with // <!]>
.
If I remove the bbcode-parser everything is fine. Is this a bug or is there an option to disable this? Below my code.
$bbcodetrans = $bbcode->render($article['content'], false, false);
Thanks!
I have got a simple question. How do I make it so this BBCode parser escapes literal square brackets?
Thank you
Hello, I have a problem, I use this script for "translate" my bbcode to html but here is my text:
[b] Test 1 [/b]
[b] Test 2 [/b]
Echo:
Test1
<br />
Test2
(I put in code else br / is translate to line skip, Test1 & 2 are nicely bold)
I believe javascript:
URLs ought to be filtered. URL tags currently allows embedding malicious inline scripts:
$bbcode = new ChrisKonnertz\BBCode\BBCode();
echo $bbcode->render("[url=javascript:alert('hacked')]malicious link[/url]");
Currently I am parsing existing BBCode and you can find every possible errors. The output is this cases is not well-formed html. Any chance to get a more forgiving parser in the future?
[/img]
`
In this example, there's a new line (needed two to make github make a visible line break :( ) before the closing tag. The generated HTML looks like this:
<img src="http://cdn.edgecast.steamstatic.com/steamcommunity/public/images/clans/28666429/702d6d88139eb439facae57989a9c6633784c519.png<br/> " />
and does not pass verification (nor HTMLPurifier). due to the
in the unclosed src attribute.
Then there is this code:
[url]http://store.steampowered.com/app/759750[url]
The closing slash was omitted. The result is:
<a href="http://store.steampowered.com/app/759750">http://store.steampowered.com/app/759750">store.steampowered.com/app/759750<a href="</a></a> /
The request is to make the HTML output standard compliant while including as much of the input as possible.
Do nested bbcode tags work? Like so:
[quote][quote]He said[/quote]she said[/quote]
Hi,
I don't know if your are still updating this, but is there a way to add a single tag like [br] or [hr] ?
I did something like this :
case self::TAG_NAME_HR: $code = '<hr/>'; break;
But it's duplicating hr twice at each [hr].
This library has a big issue, if you for example use the bbcode "font", you can add other css to the tag by closing the first one.
[font=Arial; background-color: green;]Example[/font]
I may come up with a pull request fixing this issue.
In the source code, you can find http://www.youtube.com/embed/
If you embed this in a HTTPS page, the embedded video will not load because the browser blocks mixed content.
You can solve this by writing https://www.youtube.com/embed/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.