- Starts with bytes [\x23\x30-\x39], which in ASCII is [#0-9],
- Optionally followed by \xEF\xB8\x8F (U+FE0F)
- Ends with \xE2\x83\xA3
[#0-9](?>\xEF\xB8\x8F)?\xE2\x83\xA3
<?php | |
/** | |
* @package s9e\TextFormatter | |
* @copyright Copyright (c) 2010-2013 The s9e Authors | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License | |
*/ | |
class s9e_renderer_4a947caaad587b710b013f00a0cdb582c13de74d extends \s9e\TextFormatter\Renderer { | |
protected $htmlOutput = true; | |
protected $dynamicParams = array(); |
<?xml version="1.0" encoding="utf-8"?> | |
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> | |
<xsl:output method="html" encoding="utf-8" indent="no"/> | |
<xsl:param name="L_CODE"/> | |
<xsl:param name="L_COLON"/> | |
<xsl:param name="L_IMAGE"/> | |
<xsl:param name="L_SELECT_ALL_CODE"/> | |
<xsl:param name="L_WROTE"/> | |
<xsl:param name="S_VIEWFLASH"/> | |
<xsl:param name="S_VIEWIMG"/> |
<?xml version="1.0"?> | |
<stylesheet outputMethod="html"> | |
<param name="L_CODE"/> | |
<param name="L_COLON"/> | |
<param name="L_IMAGE"/> | |
<param name="L_SELECT_ALL_CODE"/> | |
<param name="L_WROTE"/> | |
<param name="S_VIEWFLASH"/> | |
<param name="S_VIEWIMG"/> | |
<param name="S_VIEWSMILIES"/> |
<?php | |
/** | |
* @package s9e\TextFormatter | |
* @copyright Copyright (c) 2010-2015 The s9e Authors | |
* @license http://www.opensource.org/licenses/mit-license.php The MIT License | |
*/ | |
class s9e_renderer_ce909dab57a18a593f7b8550a36d254b58350f5f extends \s9e\TextFormatter\Renderer | |
{ | |
protected $params = array('L_CODE' => '', 'L_COLON' => '', 'L_IMAGE' => '', 'L_SELECT_ALL_CODE' => '', 'L_WROTE' => '', 'S_VIEWFLASH' => '', 'S_VIEWIMG' => '', 'S_VIEWSMILIES' => '', 'T_SMILIES_PATH' => ''); |
<div>It's a Gist!</div> |
<p>@x00 Sure, a lot of people hate XML for whatever reasons. As far as I’m concerned, I couldn’t dream of a better format for storing parsed text and here’s why. This is all the code you need to transform the XML back to text:</p> | |
<pre><code class="">return htmlspecialchars_decode(strip_tags($xml), ENT_QUOTES);</code></pre> | |
<p>If the XML is loaded in a DOM, all you need is to read its textContent to get the same result. If I die, every copy of the library disappears and XML is outlawed by a planet-wide decree, any programmer would only need one look at the data to understand how to get the original text back.</p> | |
<p>As for the increased size due to metadata, I invite you to run your own experiment on actual data and see that this does not double. <a href="https://gist.github.com/s9e/0ee8433f5a9a779d08ef">Here’s a gist containing this post as text, XML, and HTML.</a></p> | |
<p>@Bleistivt If you want to add a column to your database schema, I recommend you do it for search. Because if you index the markup in t |
<?php | |
define('IN_PHPBB', true); | |
$phpbb_root_path = (defined('PHPBB_ROOT_PATH')) ? PHPBB_ROOT_PATH : './'; | |
$phpEx = substr(strrchr(__FILE__, '.'), 1); | |
include($phpbb_root_path . 'common.' . $phpEx); | |
include($phpbb_root_path . 'includes/functions_display.' . $phpEx); | |
$user->session_begin(); | |
$auth->acl($user->data); |
<?php | |
include '/s9e/TextFormatter/src/autoloader.php'; | |
$configurator = new s9e\TextFormatter\Configurator; | |
$tagName = 'MENTION'; | |
$tag = $configurator->tags->add($tagName); | |
$tag->attributes->add('username'); | |
$tag->attributes->add('id')->filterChain->append('#uint'); | |
$tag->filterChain->prepend('mentionator::addId')->addParameterByName('mentionator'); |
<?php | |
include '/s9e/TextFormatter/src/autoloader.php'; | |
$xml = s9e\TextFormatter\Utils::replaceAttributes( | |
'<r><MENTION id="123">@Bob</MENTION><MENTION id="345">@NotBob</MENTION></r>', | |
'MENTION', | |
function ($attributes) | |
{ | |
if ($attributes['id'] === '123') |