Changeset 2604810
- Timestamp:
- 09/25/2021 11:36:17 AM (5 years ago)
- Location:
- blogtext/trunk
- Files:
-
- 6 edited
-
admin/settings.php (modified) (3 diffs)
-
blogtext.php (modified) (1 diff)
-
markup/blogtext_markup.php (modified) (10 diffs)
-
markup/table_base.php (modified) (1 diff)
-
readme.txt (modified) (3 diffs)
-
style/blogtext-default.css (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
blogtext/trunk/admin/settings.php
r2003725 r2604810 81 81 'Specifies whether image captions that are specified directly in the Interlink (ie. as ' 82 82 .'<code>[[image:myimage.jpg|My caption]]</code>) are displayed by default. If this is enabled, ' 83 .'a caption can be disabled by adding <code>nocaption</code> as parameter. If this is disabled '84 .'the caption will only be shown when the user moves the mouse cursor over the image - unless '83 .'a caption can be disabled by adding <code>nocaption</code> as a parameter. If this is disabled ' 84 .'the caption will only be shown when the user moves the mouse cursor over the image - unless ' 85 85 .'the parameter <code>caption</code> is added to the Interlink.'); 86 86 } … … 103 103 if (isset($content_width) && $content_width > 0) { 104 104 $desc_short = $content_width.' pixel'; 105 $desc_long = 'The theme specifies its content width with'.$content_width.' pixel. Unless you want '105 $desc_long = 'The current theme specifies its content width as '.$content_width.' pixel. Unless you want ' 106 106 . 'another content width, you can set this option to zero (0).'; 107 107 } else { … … 115 115 .'is used to limit the width of images used in posts and pages. If this is 0, the theme is ' 116 116 .'checked whether it specifies the width in the global variable <code>$content_width</code>. ' 117 .'If this variable isn\'t available, the image widths won\' be constrained.'117 .'If this variable isn\'t available, the image widths won\'t be constrained.' 118 118 .'<br/><br/>' 119 119 .$desc_long, -
blogtext/trunk/blogtext.php
r2004620 r2604810 2 2 /* 3 3 Plugin Name: BlogText for WordPress 4 Plugin URI: http ://wordpress.org/extend/plugins/blogtext/4 Plugin URI: https://blogtext.mayastudios.com/ 5 5 Description: Allows you to write your posts and pages with an alternative, easy-to-learn, and fast-to-type syntax 6 Version: 0.9. 96 Version: 0.9.10 7 7 Author: Sebastian Krysmanski 8 Author URI: http ://mayastudios.com8 Author URI: https://manski.net 9 9 */ 10 11 ######################################################################################### 12 # 13 # Copyright 2010-2018 Maya Studios (http://www.mayastudios.com) 14 # 15 # This program is free software: you can redistribute it and/or modify 16 # it under the terms of the GNU General Public License as published by 17 # the Free Software Foundation, either version 3 of the License, or 18 # (at your option) any later version. 19 # 20 # This program is distributed in the hope that it will be useful, 21 # but WITHOUT ANY WARRANTY; without even the implied warranty of 22 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 # GNU General Public License for more details. 24 # 25 # You should have received a copy of the GNU General Public License 26 # along with this program. If not, see <http://www.gnu.org/licenses/>. 27 # 28 ######################################################################################### 29 10 # ^-- https://developer.wordpress.org/plugins/the-basics/header-requirements/ 30 11 31 12 require_once(dirname(__FILE__).'/api/commons.php'); -
blogtext/trunk/markup/blogtext_markup.php
r2004620 r2604810 27 27 // * "(?:" : non-capturing subpattern (http://www.php.net/manual/en/regexp.reference.subpatterns.php) 28 28 // * "(?<=", "(?<!", "(?=", "(?!" : Assertions (http://www.php.net/manual/en/regexp.reference.assertions.php) 29 // * "+?", "*?" : ungreedy versions of "+" and "*" (http://www.php.net/manual/en/regexp.reference.repetition.php)29 // * "+?", "*?" : non-greedy versions of "+" and "*" (http://www.php.net/manual/en/regexp.reference.repetition.php) 30 30 // * "(?R)" : recursion 31 31 // * Modifiers: http://php.net/manual/de/reference.pcre.pattern.modifiers.php … … 43 43 44 44 // BlogText short codes using the [[ ]] syntax 45 // NOTE: We don't use just single brackets (i e. [ ]) as this is already use by Wordpress' Shortcode API45 // NOTE: We don't use just single brackets (i.e. [ ]) as this is already use by WordPress' Shortcode API 46 46 // NOTE: Must run AFTER "headings" and BEFORE the tables, as the tables also use pipes 47 47 // NOTE: Must work with [[...\]]] (resulting in "...\]" being the content … … 76 76 77 77 // simple tables - Creole syntax 78 // NOTE: Need to be done AFTER "complex_tables" as the y syntaxes otherwise may collide (eg. on the78 // NOTE: Need to be done AFTER "complex_tables" as the syntaxes otherwise may collide (e.g. on the 79 79 // table caption) 80 80 'simple_table' => … … 82 82 '/\n(\|(?!\+)[^|]+\|.+(?:\n\|(?!\+)[^|]+\|.+)*)(?:\n\|\+(.+))?/', 83 83 84 // Ordered (#) and unordered (*) lists; definition list (;)84 // Ordered (#) and unordered (*) lists; definition list (;) 85 85 // NOTE: The user can't start a list with "**" (list with sublist). 86 // NOTE: Indentations in lists must be done with at least two spaces/tabs. Otherwise it's too easy to accidentally86 // NOTE: Indentations in lists must be done with at least two spaces/tabs. Otherwise, it's too easy to accidentally 87 87 // insert a space and thereby add a line to a list. This also "fixes" the problem of having a more-link directly 88 88 // after a list being placed inside the list. … … 155 155 /** 156 156 * This array contains the amount each id has occurred in this posting. This is used to alter ids (by 157 * appending a number) so that the remain unique. Eg. this will result in "my_id", "my_id_2", "my_id_3", ...157 * appending a number) so that they remain unique. E.g. this will result in "my_id", "my_id_2", "my_id_3", ... 158 158 */ 159 159 private $id_suffix = array(); … … 183 183 // 184 184 185 // Handles regular links to post (i e. without prefix), as well as attachment and WordPress links (such185 // Handles regular links to post (i.e. without prefix), as well as attachment and WordPress links (such 186 186 // as categories, tags, blogroll, and archive). 187 187 self::register_interlink_handler(self::$interlinks, new WordpressLinkShortCodeHandler()); … … 262 262 $ret = $this->unmaskAllTextSections($ret); 263 263 264 // Remove line breaks from the start and end to prevent Word press from adding unnecessary paragraphs264 // Remove line breaks from the start and end to prevent WordPress from adding unnecessary paragraphs 265 265 // and line breaks. 266 266 return trim($ret); … … 269 269 /** 270 270 * Clears the page cache completely or only for the specified post. 271 * @param int|null $post if this is "null", the whole cache will be cleared. Otherwise only the cache for271 * @param int|null $post if this is "null", the whole cache will be cleared. Otherwise, only the cache for 272 272 * the specified post/page id will be cleared. 273 273 */ … … 1469 1469 $row = new ATM_TableRow(); 1470 1470 1471 foreach (explode('|', $row_code) as $cell_code) {1471 foreach (explode('|', substr($row_code, 1)) as $cell_code) { 1472 1472 // NOTE: DON'T trim the cell code here as we need to differentiate between "|= text" and "| =text". 1473 if ( empty($cell_code)) {1473 if ($cell_code === "") { 1474 1474 // can only be happening on the last element - still we need to add it so that we can remove the 1475 1475 // last element below in a secure way … … 1477 1477 } else { 1478 1478 if ($cell_code[0] == '=') { 1479 $row->cells[] = new ATM_TableCell(ATM_TableCell::TYPE_TH, trim(substr($cell_code, 1)));1479 $row->cells[] = new ATM_TableCell(ATM_TableCell::TYPE_TH, substr($cell_code, 1)); 1480 1480 } else { 1481 $row->cells[] = new ATM_TableCell(ATM_TableCell::TYPE_TD, trim($cell_code));1481 $row->cells[] = new ATM_TableCell(ATM_TableCell::TYPE_TD, $cell_code); 1482 1482 } 1483 1483 } 1484 1484 1485 1485 $last_cell = $row->cells[count($row->cells) - 1]; 1486 if ( empty($last_cell->cell_content) && $last_cell->cell_type == ATM_TableCell::TYPE_TD) {1486 if ($last_cell->isEmpty() && $last_cell->cell_type == ATM_TableCell::TYPE_TD) { 1487 1487 // Remove the last cell, if it's empty. This is the result of "| my cell |" (which would otherwise 1488 1488 // result in two cells). -
blogtext/trunk/markup/table_base.php
r2003725 r2604810 10 10 public function __construct($cell_type, $cell_content) { 11 11 $this->cell_type = $cell_type; 12 $this->cell_content = $cell_content; 12 $this->cell_content = trim(strval($cell_content)); 13 } 14 15 public function isEmpty() { 16 return $this->cell_content === ""; 13 17 } 14 18 } -
blogtext/trunk/readme.txt
r2004620 r2604810 1 1 === BlogText === 2 Stable tag: 0.9.10 2 3 Contributors: manski 3 4 Tags: formatting, markup, post 4 Requires at least: 3.0.05 Tested up to: 5.0.26 Stable tag: 0.9.97 5 Requires PHP: 5.6 8 6 License: GPLv3 or later 9 7 License URI: https://www.gnu.org/licenses/gpl-3.0.html 8 Requires at least: 3.0.0 9 Tested up to: 5.8.1 10 10 11 11 BlogText is a plugin for WordPress that adds a simple wiki-like syntax to WordPress and enriches it with a good Wordpress editor integration. … … 45 45 == Changelog == 46 46 47 = 0.9.10 = 48 * Fixed some bugs (issues #29, #35, #36) 49 * Updated NPM packages to fix a security vulnerability 50 47 51 = 0.9.9 = 48 52 * Change: Removed all custom thumbnail creation code. Instead, BlogText now just uses the actual image - with appropriate `max-width` styling. For reasoning, see issue #22. … … 52 56 * Fix: Quotes in Interlinks now work properly 53 57 * Fix: `%%` can now be used in code blocks (issue #21) 54 * Fix: A single `]` is now supported in shortcodes (issue s#17)58 * Fix: A single `]` is now supported in shortcodes (issue #17) 55 59 56 60 = 0.9.8 = -
blogtext/trunk/style/blogtext-default.css
r2004620 r2604810 1 d iv.error pre.stack-trace .func-name,p.table-caption{font-weight:700}dd p.no-margin,dt p.no-margin,li p.no-margin{margin-bottom:0!important}span.strike{text-decoration:line-through}span.underline{text-decoration:underline}p.table-caption{text-align:center;font-size:80%;margin-top:-20px}p.indented{padding-left:2em}.align-left{float:left;clear:left;margin:0 10px 10px 0!important}.align-right{float:right;clear:right;margin:0 0 10px 10px!important}.align-center{margin:0 auto 1em!important;text-align:center}.align-center>.image-caption{text-align:left}div.image-frame .image-caption{margin:0;padding:.05em .5em .3em;font-size:85%;line-height:120%;color:#999;font-style:italic;text-align:center}.toc{max-width:60%;border:1px solid #AAA;background-color:#F9F9F9;padding:.7em 1.7em;margin:1.5em;font-size:80%}.toc .toc-title{font-size:1.2em;border-bottom:1px solid #ccc;margin-bottom:.5em}.toc .toc-toggle{font-size:75%;text-decoration:none;display:block;float:right;margin-left:5px}.toc ul,.toc ul li{margin-left:0}.toc ul{list-style-type:none;list-style-image:none;margin-bottom:0!important;padding-left:0;text-align:left}.toc ul ul{margin:0 0 0 1.5em!important}a.heading-link:link,a.heading-link:visited{color:#D7D7D7;text-decoration:none}*>a.heading-link:link,*>a.heading-link:visited{visibility:hidden}h1:hover a.heading-link,h2:hover a.heading-link,h3:hover a.heading-link,h4:hover a.heading-link,h5:hover a.heading-link,h6:hover a.heading-link{visibility:visible}.code,pre{white-space:pre;padding:5px;margin-bottom:24px;overflow-x:auto;font-family:Monaco,Consolas,"Lucidia Console","Lucidia Sans Typewriter","Courier New",Courier,monospace;font-size:9pt;line-height:1.2em}.code table{table-layout:auto}.code table pre{overflow:visible}div.code-linenum{white-space:normal}.code table,.code td,.code td pre,.code tr{margin:0!important;padding:0!important;background:0 0!important;border-width:0!important}.code td{vertical-align:baseline}.code td.ln{padding-right:4px!important;width:0;overflow-x:visible}.code td.de1{padding-left:6px!important;width:100%}.error{-moz-border-radius:3px;background-color:#FFEBE8;border:1px solid #C00;padding:0 .6em}div.error{margin:5px 15px 2px}div.error p,div.error pre.stack-trace{line-height:1.2!important;margin:.5em 0!important;padding:2px!important;font-size:12px!important}div.error pre.stack-trace{background-color:#FFEBE8;overflow-x:scroll}1 dd p.no-margin,dt p.no-margin,li p.no-margin{margin-bottom:0!important}span.strike{text-decoration:line-through}span.underline{text-decoration:underline}p.table-caption{text-align:center;font-size:80%;font-weight:700;margin-top:-20px}p.indented{padding-left:2em}.align-left{float:left;clear:left;margin:0 10px 10px 0!important}.align-right{float:right;clear:right;margin:0 0 10px 10px!important}.align-center{margin:0 auto 1em auto!important;text-align:center}.align-center>.image-caption{text-align:left}div.image-frame .image-caption{margin:0;padding:.05em .5em .3em .5em;font-size:85%;line-height:120%;color:#999;font-style:italic;text-align:center}.toc{max-width:60%;border:1px solid #aaa;background-color:#f9f9f9;padding:.7em 1.7em;margin:1.5em;font-size:80%}.toc .toc-title{font-size:1.2em;border-bottom:1px solid #ccc;margin-bottom:.5em}.toc .toc-toggle{font-size:75%;text-decoration:none;display:block;float:right;margin-left:5px}.toc ul{list-style-type:none;list-style-image:none;margin-left:0;margin-bottom:0!important;padding-left:0;text-align:left}.toc ul li{margin-left:0}.toc ul ul{margin:0 0 0 1.5em!important}a.heading-link:link,a.heading-link:visited{color:#d7d7d7;text-decoration:none}*>a.heading-link:link,*>a.heading-link:visited{visibility:hidden}h1:hover a.heading-link,h2:hover a.heading-link,h3:hover a.heading-link,h4:hover a.heading-link,h5:hover a.heading-link,h6:hover a.heading-link{visibility:visible}.code,pre{white-space:pre;padding:5px;margin-bottom:24px;overflow-x:auto;font-family:Monaco,Consolas,"Lucidia Console","Lucidia Sans Typewriter","Courier New",Courier,monospace;font-size:9pt;line-height:1.2em}.code table{table-layout:auto}.code table pre{overflow:visible}div.code-linenum{white-space:normal}.code table,.code td,.code td pre,.code tr{margin:0!important;padding:0!important;background:0 0!important;border-width:0!important}.code td{vertical-align:baseline}.code td.ln{padding-right:4px!important;width:0;overflow-x:visible}.code td.de1{padding-left:6px!important;width:100%}.error{-moz-border-radius:3px 3px 3px 3px;background-color:#ffebe8;border:1px solid #c00;padding:0 .6em}div.error{margin:5px 15px 2px}div.error p,div.error pre.stack-trace{line-height:1.2!important;margin:.5em 0!important;padding:2px!important;font-size:12px!important}div.error pre.stack-trace{background-color:#ffebe8;overflow-x:scroll}div.error pre.stack-trace .func-name{font-weight:700}
Note: See TracChangeset
for help on using the changeset viewer.