multi-line notes not showing first line when folded

Bug #1278758 reported by Roger Jolly
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
webtrees
Fix Released
Low
fisharebest

Bug Description

Before version 1.5.2 a multi-line note would show its first line as a kind of title when folded. In version 1.5.2 this is no longer the case and a folded note will show no information about its contents.

webtrees version: 1.5.2

Tested with:
Safari 7.0.1 / MacOSX Mavericks
Firefox 27 / MacOSX Mavericks

Revision history for this message
Roger Jolly (roger-jolly) wrote :
Revision history for this message
fisharebest (fisharebest) wrote :

In 1.5.2, we allow more formatting options for notes. In particular, notes can be styled using "Markdown".

This presents problems in identifying the "first line".

It is possible to specify markup (markdown!) that gives, for example, something like this:

<a href="www.example.com"> This is a link
to the example site</a>

Now, if we just show the first line, it has the open tag, but not the close tag. We can't just show this or it will break the layout.

Couldn't we just strip out all tags on the first line? We could, but this has other problems. For example, the open/close would need a different "first-line" on each view, and these may not even contain the same text.

Couldn't we just show the first line when it doesn't contain markup? We could - but this would lead to inconsistent and confusing behaviour.

So, the new behaviour is actually working as designed. I'm open to suggestions here, but I already looked at the problem, and didn't see a solution.

Revision history for this message
Bert Koorengevel (bert-koorengevel) wrote :

One solution would be to remove all markup and take the first 10 words or so.
That could also function as the anchor for the link to the Shared note itself
see https://bugs.launchpad.net/webtrees/+bug/1279315

Revision history for this message
Roger Jolly (roger-jolly) wrote :

If the problem is detecting the first line, you could solve that by adding a separate title input field, that would map to the text after the NOTE tag in raw view. The text in the textarea would correspond to one or more CONT tags. In both fields markup could be used, but as the title field cannot contain line breaks, there's no risk of layout breaking.
Also, and here I could be the victim of wishful thinking, it seems to me more people would be inconvenienced by not having a title to go with their notes than would profit from having the ability to split up their markup over the first couple of lines. ;-)

Revision history for this message
fisharebest (fisharebest) wrote :

The code that generates the formatted note has three options.

a) default - URLs are converted to links
b) markdown
c) census assistant

The code that displays notes (and has to do the first line separation) doesn't know how the note was created.

So, we need a way to take arbitrary HTML and extract the first line. This first line might be the first line of a table, or contain incomplete markup, etc.

<< it seems to me more people would be inconvenienced by not having a title to go with their notesit seems to me more people would be inconvenienced by not having a title to go with their notes >>

I don't think anyone disagrees.

It is just a case of designing some foolproof logic.

Revision history for this message
fisharebest (fisharebest) wrote :

Also, turning the first line into a link can't work if the first line is already a link (allowed by markdown).

Revision history for this message
JustCarmen (justcarmen-deactivatedaccount) wrote :

If I use markdown on the first line of a note, on the note page the title is showing with the markdown as normal text which gives a weird title. The image attached shows what I mean.

The suggestion of Roger to add a separate title field is the solution for this problem.

Revision history for this message
fisharebest (fisharebest) wrote :

The logic has been changed so that when the note is collaped, the first line is shown (which becomes a link to the note object).

Changed in webtrees:
status: New → Fix Committed
importance: Undecided → Low
assignee: nobody → fisharebest (fisharebest)
Revision history for this message
fisharebest (fisharebest) wrote :

Fix released in 1.6.0

Changed in webtrees:
status: Fix Committed → Fix Released
Revision history for this message
Roger Jolly (roger-jolly) wrote : Re: [Bug 1278758] multi-line notes not showing first line when folded

The solution looks great

Thanks!

On 12 okt. 2014, at 18:41, fisharebest <email address hidden> wrote:

> Fix released in 1.6.0
>
> ** Changed in: webtrees
> Status: Fix Committed => Fix Released
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1278758
>
> Title:
> multi-line notes not showing first line when folded
>
> Status in webtrees:
> Fix Released
>
> Bug description:
> Before version 1.5.2 a multi-line note would show its first line as a
> kind of title when folded. In version 1.5.2 this is no longer the case
> and a folded note will show no information about its contents.
>
> webtrees version: 1.5.2
>
> Tested with:
> Safari 7.0.1 / MacOSX Mavericks
> Firefox 27 / MacOSX Mavericks
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/webtrees/+bug/1278758/+subscriptions

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.