Skip to content

Commit

Permalink
0.1.9
Browse files Browse the repository at this point in the history
  • Loading branch information
martec committed Jul 15, 2017
1 parent 65356ef commit 4a1a43f
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 65 deletions.
4 changes: 2 additions & 2 deletions rin/editor/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
"type": "phpbb-extension",
"description": "Rin Editor for phpBB",
"homepage": "https://github.com/martec/Rin-Editor_for_phpBB",
"version": "0.1.8",
"time": "2017-07-14",
"version": "0.1.9",
"time": "2017-07-15",
"license": "GPL-2.0",
"authors": [
{
Expand Down
24 changes: 24 additions & 0 deletions rin/editor/event/main_listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ static public function getSubscribedEvents()
'core.viewtopic_modify_page_title' => 'initialize_rceditor',
'core.viewtopic_post_rowset_data' => 'initialize_rcequickquote',
'core.text_formatter_s9e_parser_setup' => 'rce_bbcode_perm',
'core.text_formatter_s9e_configure_after' => 'rce_rmv_ignws',
'core.text_formatter_s9e_render_after' => 'rce_parse_change',
);

return $Default_Event;
Expand All @@ -94,6 +96,28 @@ public function initialize_rcequickquote($event)
}
}

public function rce_rmv_ignws($event)
{
$event['configurator']->rulesGenerator->remove('IgnoreWhitespaceAroundBlockElements');
}

public function rce_parse_change($event)
{
$patterns = array('/<\/blockquote><br>/', '/<\/div><br>/', '/<\/address><br>/', '/<\/article><br>/', '/<\/aside><br>/', '/<\/canvas><br>/',
'/<\/dd><br>/', '/<\/dl><br>/', '/<\/dt><br>/', '/<\/fieldset><br>/', '/<\/figcaption><br>/', '/<\/figure><br>/', '/<\/footer><br>/',
'/<\/form><br>/', '/<\/h1><br>/', '/<\/h2><br>/', '/<\/h3><br>/', '/<\/h4><br>/', '/<\/h5><br>/', '/<\/h6><br>/', '/<\/header><br>/',
'/<\/hgroup><br>/', '/<\/hr><br>/', '/<\/li><br>/', '/<\/main><br>/', '/<\/nav><br>/', '/<\/noscript><br>/', '/<\/ol><br>/', '/<\/output><br>/',
'/<\/p><br>/', '/<\/pre><br>/', '/<\/section><br>/', '/<\/table><br>/', '/<\/tfoot><br>/', '/<\/ul><br>/', '/<\/video><br>/');

$replacements = array('</blockquote>', '</div>', '</address>', '</article>', '</aside>', '</canvas>',
'</dd>', '</dl>', '</dt>', '</fieldset>', '</figcaption>', '</figure>', '</footer>',
'</form>', '</h1>', '</h2>', '</h3>', '</h4>', '</h5>', '</h6>', '</header>',
'</hgroup>', '</hr>', '</li>', '</main>', '</nav>', '</noscript>', '</ol>', '</output>',
'</p>', '</pre>', '</section>', '</table>', '</tfoot>', '</ul>', '</video>');

$event['html'] = preg_replace($patterns, $replacements, $event['html']);
}

public function rce_get($key)
{
$map = $this->rce_get_array(array($key));
Expand Down
74 changes: 37 additions & 37 deletions rin/editor/styles/all/template/js/ckeditor.js

Large diffs are not rendered by default.

15 changes: 0 additions & 15 deletions rin/editor/styles/all/template/js/contents.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ body
line-height: 1.4;
}

.cke_editable table+br,
.cke_editable hr+br,
.cke_editable div+br,
.cke_editable ul+br,
.cke_editable ol+br,
.cke_editable dl+br,
.cke_editable form+br,
.cke_editable blockquote+br,
.cke_editable code+br,
.cke_editable pre+br,
.cke_editable p+br
{
display: none;
}

p {
margin: 0px;
}
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 4a1a43f

Please sign in to comment.