Can I get my line breaks back?

Can I get my line breaks back?

by Ray Kingdon -
Number of replies: 8
On both the 1.5 sites I'm running, the line breaks in forum posts, new items, general info... are being filtered out. The HTML editor is putting them in but format_text(?) is stripping them on display. I've searched through loads of admin settings and added a few filters but can't see what to set (or what to unset). So most text in my sites is written out as long lines. Paragraph tags are OK, they are coming through, it's the line break tag that gets filtered out. Unfortunately, the editor's more fond of line breaks than paragraphs...
Any suggestions (btw line breaks work fine here).

Average of ratings: -
In reply to Ray Kingdon

Re: Can I get my line breaks back?

by Gustav W Delius -

I have fixed that. Someone was too eager when replacing <br> by <br /> which removed the line break from the list of allowed tags and therefore they were cleaned away by clean_text() as you suspected.

(Thanks for reporting this. In general bugs in the latest development version are best reported on the bug tracker)

In reply to Gustav W Delius

Re: Can I get my line breaks back?

by Ray Kingdon -
Gustav, great news. I thought it was me not setting something rather than a Bug. There's a whole new section on the HTLM editor which I've only just discovered when looking for editor settings blush.
In reply to Ray Kingdon

Re: Can I get my line breaks back?

by Steve Spyker -

You refer to a "whole new section." Where is it and do you think it would help stop me from going nuts trying to figure out how line breaks work within the Moodle HTML editor (the thing I seem to be using right now posting to this forum, though I've seen the problem mainly trying to type in course descriptions)? I keep trying to make the text "flow" as it's intended to in HTML, but all kinds of invisible line breaks keep showing up; I say invisible because I don't see anything in code view to explain them, but I can get rid of them by going to the end of each line in the code view and hitting Delete-space. I also get an invisible break at the top of each entry that comes back every time I re-save the course settings, no matter how many times I have deleted it. (In other words I delete it, it goes away, but the next time someone tries to change anything in the course setting it comes back again, even if they don't touch the WISYWIG window).
At any rate, I'd love to understand how all this works. I thought I was pretty HTML savvy, but this is making me feel pretty clueless. dead

In reply to Steve Spyker

Re: Can I get my line breaks back?

by Chardelle Busch -
Picture of Core developers
Thanks for letting us know what is going on Gustav (like Ray, I was wondering what had changed).  I have been putting all of my text into tables with a fixed pixel width to keep it from running on.............  Which is a quick fix for now, Steve.  Also, keep in mind that the html editor will pick up funny tags from Word if you happen to be pasting in text from a doc--so it helps in that case to use the Clean Word HTML tool.
In reply to Steve Spyker

Re: Can I get my line breaks back?

by Mira Vogel -
Hello Steve,

I've got a work-around for the same problem - mine was with a cloze quiz incorporating short answer questions (fill-in-the-blanks). Background - in Moodle's html editor the quiz was self-formatting - specifically, it was adding line breaks which as well as being aesthetically unwanted also interfered with the way my quiz's feedback displayed.

My approach was to check for line breaks by pasting into Dreamweaver's code view, switching off word wrap to expose all breaks and deleting the unwanted ones. I'm expecting this to work in Notepad. As you say, as soon as anybody makes changes in Moodle the unwanted line breaks come back - because of this I'm going to make all changes to the Dreamweaver/Notepad version from now on and paste into Moodle at the very end

Just a workaround I'm afraid - but it's ok for now.

Question: does anybody know of a free, easy-to-use, plain, clean text editor I could recommend to our staff for this? (I'm using Firefox 1 on Windows XP).

Mira
In reply to Mira Vogel

Re: Can I get my line breaks back?

by Steve Spyker -

Thanks Mira. It's nice to know someone understands the problem, even if the solution is a little clunky. Hopefully someone will figure out a way to do the same thing within "Text Mode," and find a way to keep the unwanted breaks from returning. Nothing is more maddening than software that thinks it knows better what you want than you do. (The most impassioned complaints I get as a support person--as in the times I come closest to getting my head ripped off and handed to me--are all some variation on that scenario.)

In reply to Steve Spyker

Re: Can I get my line breaks back?

by Mira Vogel -
Steve, I know what you mean. Though our tutors don't seem to get grizzly so much as overwhelmed and uncertain about persevering. I have to do a lot of spin about our open source ethos and how all software is buggy &tc &tc &tc.  Ah well... The latest quiz is working now and is doing all we want it to do. The procedures for cleaning the code are a bit convoluted, but I think the tutor in question is up to it. smile