Pasting Google Doc loses bold and alignment formatting

Hi there,
when pasting simple Google docs into the composer we see formatting getting lost.
Bold and alignment (left, center, right) get lost completely. Headlines get properly converted when marked as such in the original Google document.

The text below is pasted from a Google doc and loses bold as well as centered text information.

I paste the text directly from this Google doc:


Heading 1

Heading 2

Heading 3

Some text centered

In publishing and graphic design, Lorem ipsum is a placeholder text commonly used to demonstrate the visual form of a document or a typeface without relying on meaningful content. Lorem ipsum may be used as a placeholder before the final copy is available.

Strong text


Other observations:
Pasting from a Word document converts strongs but also looses alignment information.

On our managed instance I don’t see the strong text to be wrapped into a B or STRONG tag, so I cant style it accordingly.

Any help is appreacitated.

The “Strong text” above was converted to a H2 which is not what we want.

Can anyone from the discourse team provide an update here? Thanks

Document does not contain an HTML syntax then it will be converted to Markdown and there’s no Markdown syntax to center text, images, titles etc. To center texts you need to use HTML, as example:

<div align=center>Centered text</div>

will become

Centered text

This is not a bug and is happening because you added a dotted line immediately under “Strong Text”

See as example:

Strong text
---

will be transformed in H2 heading:

Strong text

More info at babelmark3 | Compare Markdown Implementations.

In markdown a dotted line will be converted in a horizontal line if it is separated from the text with a blank space:

Strong text

---

will be transformed in:

Strong text


You can use the CommonMark tutorial to learn how to use the Markdown syntax if you need it.

You can also try this theme component, MD Composer extras - theme - Discourse Meta which adds extra buttons to the composer, including those for alignment.

4 Likes