Navigation Menu

Skip to content

Commit

Permalink
Textile v3.7.3
Browse files Browse the repository at this point in the history
Thanks Gocom
  • Loading branch information
philwareham committed Sep 2, 2019
1 parent 8ccbc1a commit 1f439ae
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 20 deletions.
2 changes: 1 addition & 1 deletion HISTORY.txt
Expand Up @@ -15,7 +15,7 @@ Changes in TBC (upcoming)
* Removed: Obsolete 'no widowed words' preference setting. If this feature is
needed it can be implemented directly with <txp:title /> tag.
* Developer: PHP magic_quotes_gpc and magic_quotes_runtime support removed.
* Textile 3.7.2. See https://github.com/textile/php-textile/releases/tag/v3.7.2
* Textile 3.7.3. See https://github.com/textile/php-textile/releases/tag/v3.7.3
for full list of changes in this release (thanks, gocom).
* jQuery 3.4.1.
* PrismJS 1.17.1.
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -62,7 +62,7 @@
"copy:jquery-ui": "rimraf textpattern/vendors/jquery/jquery-ui/jquery-ui.js && cp node_modules/jquery-ui-dist/jquery-ui.min.js textpattern/vendors/jquery/jquery-ui/jquery-ui.js",
"copy:prismjs": "uglifyjs -c -m -o textpattern/vendors/PrismJS/prism/prism.js node_modules/prismjs/prism.js node_modules/prismjs/components/prism-markup-templating.js node_modules/prismjs/components/prism-bash.js node_modules/prismjs/components/prism-json.js node_modules/prismjs/components/prism-markdown.js node_modules/prismjs/components/prism-php.js node_modules/prismjs/components/prism-textile.js",
"copy:textile": "sh .github/copy-textile.sh",
"get-dependencies": "npm run copy:blueimp-file-upload && npm run copy:jquery && npm run copy:jquery-ui && npm run copy:prismjs && npm run copy:textile v3.7.2",
"get-dependencies": "npm run copy:blueimp-file-upload && npm run copy:jquery && npm run copy:jquery-ui && npm run copy:prismjs && npm run copy:textile v3.7.3",
"get-pophelp": "sh .github/get-pophelp.sh",
"get-textpacks": "sh .github/get-textpacks.sh",
"get-classic-admin-theme": "sh .github/get-classic-admin-theme.sh",
Expand Down
29 changes: 12 additions & 17 deletions textpattern/vendors/Netcarver/Textile/Parser.php
Expand Up @@ -371,7 +371,7 @@ class Parser
* @var string
*/

protected $ver = '3.7.2';
protected $ver = '3.7.3';

/**
* Regular expression snippets.
Expand Down Expand Up @@ -1926,7 +1926,7 @@ public function textileEncode($text)
*
* bc. <h1>Hello World!</h1>
*
* Additinally the parser can be run in safe, restricted mode using the
* Additionally the parser can be run in safe, restricted mode using the
* Parser::setRestricted() method.
*
* bc. $parser = new \Netcarver\Textile\Parser();
Expand Down Expand Up @@ -2384,10 +2384,10 @@ protected function prepare($lite = null, $noimage = null, $rel = null)
$this->patterns = array(
'block' => '/^(?:'.$block.')$/i',
'contained' => '/^<\/?(?P<open>[^\s<>\/]+)(?:\s.*|\/?>.*|)>$/si',
'divider' => '/^(?:<\/?('.$divider.')(?:\s[^<>]*?|\/?)>(?:<\/\1\s*?>)?)+$/smi',
'divider' => '/^(?:<\/?('.$divider.')(?:\s[^<>]*?|\/?)>(?:<\/\1\s*?>)?)+$/si',
'phrasing' => '/^(?:'.$phrasing.')$/i',
'wrapped' => '/^<\/?(?P<open>[^\s<>\/]+)[^<>]*?>(?:.*<\/\1\s*?>)?$/si',
'unwrappable' => '/<\/?(?:'.$block.')(?:\s[^<>]*?|\/?)>/smi',
'unwrappable' => '/<\/?(?:'.$block.')(?:\s[^<>]*?|\/?)>/si',
);
}

Expand Down Expand Up @@ -2511,8 +2511,6 @@ protected function parseAttribsToArray($in, $element = '', $include_id = true, $
$span = '';
$width = '';
$id = '';
$atts = '';
$align = '';
$matched = $in;

if ($element == 'td') {
Expand Down Expand Up @@ -3019,6 +3017,7 @@ protected function fTextileList($m)
$prev = false;
$out = array();
$lists = array();
$litem = '';

if ($lines === false) {
return '';
Expand Down Expand Up @@ -3103,6 +3102,8 @@ protected function fTextileList($m)
}
} elseif ($showitem) {
$line = "$tabs\t<$litem$atts>$content";
} else {
$line = '';
}

if ((!$next || $next['level'] <= $m['level']) && $showitem) {
Expand Down Expand Up @@ -3274,7 +3275,6 @@ protected function blocks($text)
$tag = 'p';
$atts = '';
$cite = '';
$graf = '';
$eat = false;
}

Expand Down Expand Up @@ -3810,7 +3810,6 @@ protected function fNoteLists($m)
if ($this->notes) {
foreach ($this->notes as $seq => $info) {
$links = $this->makeBackrefLink($info, $m['links'], $m['startchar']);
$atts = '';

if (!empty($info['def'])) {
$out[] = "\t".'<li'.$info['def']['atts'].'>'.$links.
Expand Down Expand Up @@ -3854,8 +3853,6 @@ protected function fNoteLists($m)

protected function makeBackrefLink($info, $g_links, $i)
{
$id = '';

$backlink_type = !empty($info['def']) && $info['def']['link'] ? $info['def']['link'] : $g_links;
$allow_inc = (false === strpos($this->syms, $i));

Expand Down Expand Up @@ -4281,7 +4278,6 @@ protected function fLink($m)
$m = array();

$pop = $tight = '';
$url_chars = array();
$counts = array(
'[' => null,
']' => substr_count($url, ']'), # We need to know how many closing square brackets we have
Expand Down Expand Up @@ -4317,7 +4313,6 @@ protected function fLink($m)
// Does this need to be mb_ enabled? We are only searching for text in the ASCII charset anyway
// Create an array of (possibly) multi-byte characters.
// This is going to allow us to pop off any non-matched or nonsense chars from the url
$len = strlen($url);
$url_chars = str_split($url);

// Now we have the array of all the multi-byte chars in the url we will parse the
Expand Down Expand Up @@ -4676,14 +4671,14 @@ protected function images($text)
'/
(?:[[{])? # pre
\! # opening !
(?P<align>\<|\=|\>|&lt;|&gt;)? # optional alignment $algn
(?P<atts>'.$this->cls.') # optional style,class atts $atts
(?P<align>\<|\=|\>|&lt;|&gt;)? # optional alignment
(?P<atts>'.$this->cls.') # optional attributes
(?:\.\s)? # optional dot-space
(?P<url>[^\s(!]+) # presume this is the src $url
(?P<url>[^\s(!]+) # presume this is the src
\s? # optional space
(?:\((?P<title>[^\)]+)\))? # optional title $title
(?:\((?P<title>[^\)]+)\))? # optional title
\! # closing
(?::(?P<href>\S+)(?<![\]).,]))? # optional href sans final punct. $href
(?::(?P<href>\S+)(?<![\]).,]))? # optional href sans final punct
(?:[\]}]|(?=[.,\s)|]|$)) # lookahead: space,.)| or end of string ("|" needed if image in table cell)
/x'.$this->regex_snippets['mod'],
array($this, "fImage"),
Expand Down
2 changes: 1 addition & 1 deletion textpattern/vendors/Netcarver/Textile/Tag.php
Expand Up @@ -52,7 +52,7 @@
*
* @method Tag alt(string $text)
* @method Tag align(string $alignment)
* @method Tag href(string $url, bool $allowEmpty)
* @method Tag href(string $url, bool $allowEmpty = false)
* @method Tag rel(string $relationship)
* @method Tag title(string $title)
* @internal
Expand Down

0 comments on commit 1f439ae

Please sign in to comment.