solved Use of blockquote tag in tinyMCE under Follow Me skin

TiG
TiG
@tig
7 years ago
184 posts
Odd situation using blockquote tag. It appears all HTML is allowed per tinyMCE configuration and when entering a new comment it is indeed possible to use blockquote. When the saved comment is updated with Update Comment Text the blockquote is in the HTML (viewed via code plugin).

However, when the comment is saved (via update) something seems to strip the blockquote away.

Is this a bug or am I missing something obvious?


--
TiG

updated by @tig: 11/14/17 08:52:53PM
TiG
TiG
@tig
7 years ago
184 posts
Same behavior (above) with Elastic. The blockquote tag is stripped away when an update is saved for a comment. In result, one can create a comment with blockquotes in it and it will be properly saved but one cannot change the comment and hope to retain blockquote tags. Different persistence behavior between create and modify. Seemingly at least.

( I understand that template code strips HTML for presentation purposes. )


--
TiG
douglas
@douglas
7 years ago
2,791 posts
Make sure you've allowed the HTML tag in the Allowed HTML Tags field for the quotas you want to give permission to.

ACP > Core >System Core > Quota Config

/core/admin/quota

Hope this helps!


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos

updated by @douglas: 08/14/17 08:06:50AM
TiG
TiG
@tig
7 years ago
184 posts
It did help. I clicked to apply the change to all and include blockquote. ( I was trying to address this by following the code. )

Although it no longer affects me, create functionality does not seem to strip out tags the same way as update. That is what led me down to the code rather than settings.

Thanks much, Douglas, for the help. Moving on to other experimentation with jamroom!


--
TiG
douglas
@douglas
7 years ago
2,791 posts
Glad that sorted it for you, :)


--

Douglas Hackney
Jamroom Team - Designer/Developer/Support
FAQ-Docs-Help Videos
michael
@michael
7 years ago
7,715 posts
yep, am seeing a slight difference in the formatting of the CREATE vs UPDATE comment when the editor is used. Seeing an extra
<br>
after an ordered list that goes away after the post has been updated. The contents in the editor is exactly the same for both.

Will look into it, thanks.

What HTML code are you using when you see the difference?
SteveX
SteveX
@ultrajam
7 years ago
2,584 posts
The UWE site still has an edited core to get rid of line breaks in ol and ul, they appear inside the lists which breaks validation.

In jrCore/lib/smarty.php
function jrCore_remove_unwanted_breaks($string)
{ if (strpos(' ' . $string, "<br>")) { // fix ul if (strpos(' ' . $string, "<ul")||strpos(' ' . $string, "<ul")) { $_tmp = explode( "\n", $string); if ($_tmp && is_array($_tmp)) { foreach ($_tmp as $k => $line) { if (strpos(' ' . $line, "><br>")) { $_tmp[$k] = str_replace("><br>", '>', $line); } } $string = implode("\n", $_tmp); } }
https://www.jamroom.net/the-jamroom-network/forum/jamroom-developers/38900/tinymce-inserting-line-breaks-into-some-list-items


--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
michael
@michael
7 years ago
7,715 posts
I went with this in /modules/jrComment/templates/item_list.tpl
                    {if isset($_conf.jrComment_editor) && $_conf.jrComment_editor == 'on'}
                        {$item.comment_text|jrCore_format_string:$item.profile_quota_id:null:"nl2br"}
                    {else}
adding the :null:"nl2br"} to the jrCore_format_string function if the editor is on. Cant think of any use-case where editor output would ever need nl2br.
TiG
TiG
@tig
7 years ago
184 posts
@michael: "What HTML code are you using when you see the difference?"

I saw the difference when using blockquote regardless of other tags. Whenever I used blockquote it would disappear if I saved via update.

I had earlier on added blockquote to the current quota (moderator). After adding blockquote to the other quotas and checking 'Apply to all Quotas' the update operation then retained the blockquote tag. Since create allowed blockquote and update did not there of course remains an undesirable difference between the two editor usages.


--
TiG
michael
@michael
7 years ago
7,715 posts
Thanks, I thought it was the BR's that was the issue.

ISSUE:
* CREATE allows blockquotes, but UPDATE doesn't allow blockquotes

Will look into it, thanks.

Tags