[float=right]https://www.youtube.com/watch?v=QH2-TGUlwu4[/float] This is a demo of the JavaScript port of [url=https://github.com/s9e/TextFormatter title="s9e\TextFormatter at GitHub.com"]s9e\TextFormatter[/url]. The following plugins have been enabled: [list] [*][b]Autolink[/b] --- loose URLs such as https://github.com are automatically turned into links [*][b]BBCodes[/b] [list=circle] [*][b]bold[/b], [i]italic[/i], [u]underline[/u], [s]strikethrough[/s], [*][color=#f05]co[/color][color=#2f2]lo[/color][color=#02f]r,[/color] [*][C][URL][/C], [C:123][C][/C:123], [C][FLOAT][/C], and [C][LIST][/C] [*][C][CODE][/C] with real-time syntax highlighting via [url=https://highlightjs.org/]highlight.js[/url] [code=php]$who = "world"; printf("Hello %s\n", $who);[/code] [/list] [*][b]Censor[/b] --- the word "apple" is censored and automatically replaced with "banana" [*][b]Emoticons[/b] --- one emoticon :) has been added [*][b]FancyPants[/b] --- some typography is enhanced, e.g. (c) (tm) and "quotes" [*][b]MediaEmbed[/b] --- links to YouTube are transformed into playable videos [*][b]Preg[/b] --- the Preg plugin provides a way to perform generic regexp-based replacements that are HTML-safe. Here, text that matches [C]/#(?<tag>[a-z0-9]+)/i[/C] is replaced with the template [C]<a href="https://twitter.com/#!/search/%23{@tag}"><xsl:apply-templates/></a>[/C] -- For example: #PHP, #fml [*][b]HTMLElements[/b] --- [C]<a>[/C] and [C]<b>[/C] tags are allowed, with two whitelisted attributes for [C]<a>[/C]: [C]href[/C] and [C]title[/C]. Example: <a href="https://github.com" title="GitHub - Social Coding"><b>GitHub</b></a> [*][b]HTMLEntities[/b] --- HTML entities such as ♥ are decoded [/list] [hr] The parser/renderer used on this page has been generated by [url=https://github.com/s9e/TextFormatter/blob/master/scripts/generateLiveDemo.php]this script[/url]. It's been minified with Google Closure Compiler to 22.1 KB (9.8 KB compressed)
Autolink
BBCodes
Censor
Emoticons
FancyPants
HTMLElements
HTMLEntities
MediaEmbed
Preg