Funky formatting when posting writing


#1
This is an example of what I am referring to in the text below. I have written an interesting story and I wanted to post it and share it with others.  So, I copied the text from my favorite editor that I use all the time for editing, however, when I post it on the site it gets a strange look.

My site is one that is used by writers and as such they are often posting stories or snippets of stories. Most writing software indents the start of each paragraph and when people are cutting and pasting their work into topics it ends up looking like the above. The newlines are ignored and the text becomes one long sentence that scrolls way to the right. Additional paragraphs make it even worse. When this happens I get a message from them asking me to fix it. This gets really old after a few messages and I would really like to find a way for them to post their work while retaining their formating.

Any ideas what I may be able to do?


(Jeff Atwood) #2

Get them to stop using weird indents before paragraphs? :wink:

This has come up before in email contexts, but this is a bit different.


(Mittineague) #3

Ironic. SitePoint is a web dev forum and we spend a lot of time educating new members how to post code as code and not as text. You have a writers forum and will need to educate new members how to post text as text and not as code.

What is happening is that text on a newline preceded by 4 spaces signals Discourse to render the text as “code” aka. “pre”. For code, one reason this is desireable is so that new lines will be preserved. It also uses monospace font which programmers are familiar with and associate with code.

Anyway, your goal will be to educate new members to not indent new lines of text by 4 spaces. I sadly admit that although we have “help” pages that explain how to format posts in different ways, many if not most new members don’t seem to be reading them. At times editing a post and leaving the reason as something like “fixing by changing indentation from 4 to 2 spaces” may be enough for those members that notice their post was fixed, look at the revision, and see the reason. Many times however, a gentle and tactful “BTW” post will do the trick and has the added benefit that others too shy to ask may learn from it as well.


(Stephen) #4

Can you provide examples? I’m not aware of any which mandate this.

I regularly use apps such as scrivener and Ulysses, and while they can accommodate older conventions such as indented first lines, they’re by no means mandatory.


(Jay Pfaffman) #5

It’s not writing software that starts paragraphs with multiple spaces, it’s people who think that typing multiple spaces is how to indicate a new paragraph. This is something that I tried to teach people in the late 1980s, but it’s really hard to do.


#6

I am aware of why it is doing what it is doing, what I was asking was if there were a way to disable it or prevent it from happening on a post by post basis.


(Mittineague) #7

If you are certain that the forum doesn’t, and never will, need “code formatting” I imagine a custom plugin that not only removes the icon from the composer menu (easy to do with CSS) but also removes that from happening to pasted in or typed in posts would be possible.

AFAIK, there are existing plugins that add features to the post composer (a frequent feature request) but they might be good to look at to get an idea on how to remove a feature. (commonmark parsing leading 4 space indents and backtick characters as code)

EDIT
Something quick and easy to test would be to remove opening and closing <code> / <pre> tags so only their cooked inner content was used.


#8

It really does not matter what the software in use might be, it is more the fact that many of the authors are older and use the convention. That software can be configured to not indent the start of a paragraph, the point remains that the authors are used to this convention. Added to the fact that many of these posts are existing works, going back and reformatting them could be a lot of work. And while some software might be able to do that for them with some setup and configuration I am not sure that the trade off of me not having to fix the posts is any better than me having to direct users through many different software packages and OS’s to accomplish such a thing.

My day job is, and has been for 30+ years, engineering software and I understand what discourse it trying to do. It makes discourse a friendly forum for software discussions but it also seems rather short sighted to think that everyone posting to a discourse forum is first and foremost a developer.

-N


#9

I am relatively certain that is the case. I was hoping that just such a thing already existed, while I am sure I could cobble something together I just don’t have the time at the moment. And I don’t see that changing anytime soon between work demands and the holiday season descending upon us.

If someone could point in the direction of a plugin that might be a good start or be easily modified to accomplish my goals I would appreciate it.

Thanks!
-N