Linebreaks missing from notes in edition view.

Bug #262216 reported by Edward Betts
2
Affects Status Importance Assigned to Milestone
Open Library
Fix Released
Medium
Anand Chitipothu

Bug Description

Notes can include linebreaks. They are not visible on the edition page. The edition view template needs to be changed so it generates the HTML needed to show linebreaks.

For example: http://openlibrary.org/b/OL7146598M

Revision history for this message
Anand Chitipothu (anandology) wrote :

I put $page.notes in <pre> and set its font styles to "inherit". It looks better now.

Revision history for this message
Edward Betts (edwardbetts) wrote :

The <pre> tag doesn't allow paragraphs to wrap. I was thinking there might be a macro that does replace("\n", "<br>").

Revision history for this message
Anand Chitipothu (anandology) wrote : Re: [Bug 262216] Re: Linebreaks missing from notes in edition view.

On Thu, Aug 28, 2008 at 6:23 PM, Edward Betts <email address hidden> wrote:
> The <pre> tag doesn't allow paragraphs to wrap. I was thinking there
> might be a macro that does replace("\n", "<br>").

Replace may not be a good idea because we want to escape special
symbols present in the notes.

How about this:

$for line in page.notes.split('\n'):
    $line<br/>

Revision history for this message
George (george-archive) wrote :

Go for it :)

Changed in openlibrary:
assignee: nobody → Anand Chitipothu (anandology)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Edward Betts (edwardbetts) wrote :

Any progress?

Revision history for this message
Edward Betts (edwardbetts) wrote :
Changed in openlibrary:
importance: Low → Medium
status: Confirmed → In Progress
Revision history for this message
Anand Chitipothu (anandology) wrote :

Markdown syntax requires 2 trailing spaces at the end of the line to
give line break. This issue has been bugging many other people also.

http://github.github.com/github-flavored-markdown/
http://blog.stackoverflow.com/2009/10/markdown-one-year-later/

GitHub Flavored Markdown diverts from markdown syntax and adds
linebreak on newlines.

We should probably adopt that. As a consequence we should also fix the
preview in WMD editor.

I will look at it after softlaunch.

Revision history for this message
Edward Betts (edwardbetts) wrote :

We need to decide if the notes field contains markdown or plain text.

Revision history for this message
Anand Chitipothu (anandology) wrote :

On Fri, Dec 25, 2009 at 1:47 AM, Edward Betts <email address hidden> wrote:
> We need to decide if the notes field contains markdown or plain text.

any reason not to use markdown?

Changed in openlibrary:
milestone: none → upstream
Revision history for this message
George (george-archive) wrote :

+1 for Flavored Markdown. That trailing spaces issue is confusing.

And, the notes field is no more, right?
So, any/all multi-line text fields should use Markdown.

Revision history for this message
Anand Chitipothu (anandology) wrote :

We do use notes field in edition edit form in librarian mode.

I fixed markdown rendering to add line breaks and autolink urls.

Revision history for this message
Anand Chitipothu (anandology) wrote :

I had to remove "white-space: pre-line" style from "#contentBody p" to make it render as intended. Lance, is it required?

Revision history for this message
Edward Betts (edwardbetts) wrote :

We load data from the MARC records into the notes field. Notes in the MARC record aren't written in markdown.

If we're using markdown in a field it we should expect users to user to newlines when they want a '<p>' and double space at the end of the line for '<br>'. Markdown is the wiki syntax we've chosen to use.

Anand: What do you mean by 'fixed markdown rendering to add line breaks?'.

Revision history for this message
Lance Arthur (lance-arthur) wrote :

The white-space CSS was inserted for this exact purpose (make all entries using Markdown conform to exact line breaks and spacings) so it is no longer necessary if Markdown has been altered.

Revision history for this message
Anand Chitipothu (anandology) wrote :

> Anand: What do you mean by 'fixed markdown rendering to add line
> breaks?'.

Implemented this:

http://github.github.com/github-flavored-markdown/

Changed in openlibrary:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.