dedalozzo / converter Goto Github PK
View Code? Open in Web Editor NEWA set of classes to translate a text from a HTML to BBcode and from BBCode to Markdown.
License: Apache License 2.0
A set of classes to translate a text from a HTML to BBcode and from BBCode to Markdown.
License: Apache License 2.0
Hello, I'm trying to use your converter (thank you) to convert some code, but the problem is it has some tags without href, for which your library throws a malformed link exception. The in the code I want to convert are like:
<a rel="nofollow">4d10f06 </a>
The little research I have done says points that that is valid HTML.
Why are all images converted to lower case?
The case "can" matter, so why force to lower?
Hello
I am new to php namespaces and classes
I try to include your files like this
folder bb-converter
files
BBCodeConverter.php
HTMLConverter.php
Converter.php
index.php
<?php
namespace Converter;
include(dirname(__FILE__).'/BBCodeConverter.php');
include(dirname(__FILE__).'/HTMLConverter.php');
include(dirname(__FILE__).'/Converter.php');
//include(dirname(__FILE__).'/Converter/BBCodeConverter.php');
//include(dirname(__FILE__).'/Converter/HTMLConverter.php');
//include(dirname(__FILE__).'/Converter/Converter.php');
#HTML to BBCode conversion:
$id = 1;
$text = '<b>Bold</b>';
//$converter = new Converter\HTMLConverter($text, $id);
$converter = new HTMLConverter($text, $id);
echo $converter->toBBCode();
when i try
http://127.0.0.1/bb-converter/
I got this fatal error
Fatal error: Class 'Converter\Converter' not found in C:\xampp\htdocs\bb-converter\BBCodeConverter.php on line 16
Sorry for this newbie question,
can you advice how to proper include your converter.
Thank you
Hey I'm working on a project that needs to convert a forum from BBcode to Markdown, there are some items not handled here. I know this project is quite old. Would you be interested in PR's or would you prefer if I just fix it on my for and leave it alone?
Thanks for the code and have a super day!
Thanks for your library, it helped me a great deal.
However, this should either be converted to Markdown link ([https://github.com](https://github.com)
) or the URL tags should be stripped:
$input = '[url]https://github.com[/url]';
$Converter = new \Converter\BBCodeConverter($input);
$output = $Converter->toMarkdown();
// $output == $input
Thanks for this little converter. It's simple and does the job.
It'd be nice to have a programmable support for HTML classes.
Suppose I have HTML which includes classes:
<strong class="notice">Important information</strong>
We could have a framework where we could program instances of classes, and how to render them in BBCode.
For example, class="notice" could be wrapped in red colour:
[b][color=#FF0000]Important information[/color][/b]
The library could thus be made class aware. The user could register a class and tell the library how to render it. When the converter finds a class, it looks up if it is among registered classes, and handles it appropriately.
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.