Project

General

Profile

Bug #13147

Can't underline in forum post

Added by Colin McDonald about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority name:
Normal
Assignee:
Category name:
Group Forums
Target version:
Start date:
2020-08-04
Due date:
% Done:

0%

Estimated time:

Description

I just posted a list with underlined items to the CAC team forum (screenshot attached) that rendered the underline in the preview but then just showed <span> underline tags once published. Not sure if that's the case with italics too, but bold seemed to come through fine. I've already gone back and edited the original post so it's more readable.

Screen Shot 2020-08-04 at 3.02.37 PM.png (470 KB) Screen Shot 2020-08-04 at 3.02.37 PM.png Colin McDonald, 2020-08-04 03:08 PM
2020-08-04_205201.png (6.92 KB) 2020-08-04_205201.png Raymond Hoh, 2020-08-04 11:54 PM

History

#1 Updated by Colin McDonald about 1 year ago

  • Assignee set to Boone Gorges

#2 Updated by Boone Gorges about 1 year ago

  • Category name set to Group Forums
  • Assignee changed from Boone Gorges to Raymond Hoh
  • Target version set to 1.17.1

Ray, could you have a look? I don't know whether the problem is the markup (should it use em instead?) or the allowed tags.

#3 Updated by Raymond Hoh about 1 year ago

Colin, how did you add the <span style="text-decoration:underline"> tag? There is no button to underline in the visual editor or code editor. Did you write it yourself in the code editor? Or did you press CTRL+U in the visual editor?

Technically, bbPress does not allow the <span> element to be rendered for regular users. Only super administrators can bypass this, but Colin's account isn't an administrator, so the underline shouldn't have even shown in the live preview.

However, if you used the CTRL+U approach, you would see the underline in the textarea, but not in the live preview. See attached screenshot. Maybe this is what you meant, Colin?

should it use em instead?

<em> is already used for italics by the bbPress I button.


If we want to allow underlining (and also bring back the underline button), we would have to enable the <span> element and also the style attribute in bbPress. Adding the style attribute would allow users to write any inline styles in their content. Is this something we want to allow?

Or we could write our own custom underline button with the following markup -- <span class="underline"> and enable the class attribute. This would allow underlining and we wouldn't have to open up inline styles.

#4 Updated by Colin McDonald about 1 year ago

Sorry everyone, I used CTRL+U and the underlines came through in the editor, but they must not have in the preview, and then it was too late once I hit publish to know the spans would come through. I don't think it's worthwhile to enable spans in all cases just to get underlining back (I don't often use it myself, but must have just been feeling adventurous that day...).

#5 Updated by Raymond Hoh about 1 year ago

  • Status changed from New to Staged for Production Release

(I don't often use it myself, but must have just been feeling adventurous that day...)

I was feeling adventurous so I decided to add the Underline button :)

The Underline button uses the following markup: <span class="bbp-underline">Test</span> instead of <span style="text-decoration:underline">Test</span>.

The button is available in both the Visual Editor or the Text Editor.

Commit - https://github.com/cuny-academic-commons/cac/commit/065efa6b19e4aa3d5730509a31eb4580fc52f382

#6 Updated by Colin McDonald about 1 year ago

Thanks so much, Adventurous Ray ;)

#7 Updated by Boone Gorges about 1 year ago

  • Status changed from Staged for Production Release to Resolved

Also available in: Atom PDF