Web based family history software

Question Markdown formatting

  • otmar.mayr
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 8 months ago #1 by otmar.mayr
Markdown formatting was created by otmar.mayr
The old Markdown formatting in WT 2.0.19 looks much better. The new Version in WT 2.0.21 also wastes a lot more space.


www.verwandten.info / PHP-Version 8.2 / webtrees 2.1.21

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #2 by fisharebest
Replied by fisharebest on topic Markdown formatting
Did you modify the CSS on your page (Control panel -> Custom CSS & JS)?

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

  • otmar.mayr
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 8 months ago - 2 years 8 months ago #3 by otmar.mayr
Replied by otmar.mayr on topic Markdown formatting
No, even without custom.css it's the same problem.

It seems like an extra line break increases the space between each block of text. In my text there is no line break between the dots.

A line break is also added to the headings.

You can it see here:
www.verwandten.info/wt2/index.php?route=...ephan-von-LOTHRINGEN

www.verwandten.info / PHP-Version 8.2 / webtrees 2.1.21
Last edit: 2 years 8 months ago by otmar.mayr.

Please Log in or Create an account to join the conversation.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
2 years 8 months ago - 2 years 8 months ago #4 by Bogie
Replied by Bogie on topic Markdown formatting
Same here.

I entered a text field to a source using 2 spaces before new line with webtress 2.0.19, yesterday. And it looked as expected.
After update to 2.0.21 it looks like some more line breaks were added.



The GEDCOM of the text field looks like that:
Code:
3 PAGE Nr. 83 / 1858 3 DATA 4 TEXT Gevattern: 5 CONT 1. Lisette Krüger, Schustermeisterfrau 5 CONT 2. Sophia Gütschow, Zimmergesellenfrau 5 CONT 3. Dorothea Schwarz, desgleichen 5 CONT Alle 3 hieselbst. 4 DATE 02 JAN 1858 3 QUAY 3

Bogie
webtrees 2.1.22 | PHP 8.3.12 | MariaDB 10.11.8 | Apache on Ubuntu
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen
Last edit: 2 years 8 months ago by Bogie.

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #5 by ric2015
Replied by ric2015 on topic Markdown formatting
Apparently 2.0.21 re-introduces line breaks via CONT, so you get one 'markdown' linebreak (from the two spaces), and one GEDCOM linebreak (from the CONT). This may be the intended behavior for the announced option "markdown with line-breaks" ( see this issue ), which however isn't actually available in this release.

I note that other formatting issues aren't resolved in this release either (CONT line breaks within notes aren't displayed even with markdown disabled).

Overall the best option may be to wait for 2.1, since all related issues are closed already (but the fixes apparently have not been back-ported to the 2.0 branch).

Richard

webtrees 2.2.0 at cissee.de/webtrees2
Vesta custom modules (Classic Look & Feel, Gov4webtrees, Shared Places, Extended Relationships) available at cissee.de

Please Log in or Create an account to join the conversation.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
2 years 8 months ago #6 by Bogie
Replied by Bogie on topic Markdown formatting
Thank you, Richard.

So what Greg wrote in another post might be somewhat imprecise.

Very little changed between 2.0.19 and 2.0.20.

Let me investigate...

Bogie
webtrees 2.1.22 | PHP 8.3.12 | MariaDB 10.11.8 | Apache on Ubuntu
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #7 by fisharebest
Replied by fisharebest on topic Markdown formatting
> > Very little changed between 2.0.19 and 2.0.20.

> So what Greg wrote in another post might be somewhat imprecise.

The markdown formatting issues were fixed in the 2.1 code.
Tests for this were added to the test script, so it gets checked after every code change.
Hopefully, it will not break again.

There were three significant changes in the 2.0 code:
1) new census definitions
2) the markdown fixes were copied from the 2.1 code to the 2.0 code.
3) third-party libraries were updated.

There was an issue with (3). I have been working on the 2.1 code for a long time, and forgot that 2.0 required an old version of a certain package.

Here's a summary of the Markdown problem.

I was upgrading to a newer version of the Markdown library, and needed to read the markdown specification.

It said:

* Consecutive lines should be joined together to make a paragraph - spec.commonmark.org/0.30/#paragraphs
* To create a line-break, add two spaces to the end of the line - spec.commonmark.org/0.30/#hard-line-breaks

So, I updated the code to do this.

Later, I found another comment further down the markdown specifcation. It says:

* It is valid to preserve existing line-breaks - spec.commonmark.org/0.30/#soft-line-breaks

Since the webtrees community clearly prefered this option, I changed the code (back) to do this.

Changing the logic and then changing it back was my mistake. I use markdown in my own tree, but write paragraphs as one long line, so I never noticed the change.

@Otmar - I guess you have line-breaks *and* double-spaces in your data? Can you confirm this?

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
2 years 8 months ago #8 by ric2015
Replied by ric2015 on topic Markdown formatting
> Since the webtrees community clearly prefered this option, I changed the code (back) to do this.

Ah, so the additional option "markdown with line-breaks" has also been removed again from the preferences. To summarize, the markdown spec says:

A regular line ending (not in a code span or HTML tag) that is not preceded by two or more spaces or a backslash is parsed as a softbreak.
[...]
A renderer may also provide an option to render soft line breaks as hard line breaks.


webtrees now renders soft line breaks as hard line breaks again (as it used to before 2.0.16 or so), without providing a separate option for this.

Richard

webtrees 2.2.0 at cissee.de/webtrees2
Vesta custom modules (Classic Look & Feel, Gov4webtrees, Shared Places, Extended Relationships) available at cissee.de

Please Log in or Create an account to join the conversation.

  • otmar.mayr
  • Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
2 years 8 months ago #9 by otmar.mayr
Replied by otmar.mayr on topic Markdown formatting

> > Very little changed between 2.0.19 and 2.0.20.
@Otmar - I guess you have line-breaks *and* double-spaces in your data? Can you confirm this?

a) Yes, I use line-breaks *and* xxxxx-spaces in many text-files? I cannot see the line-breaks, but I can see the spaces.
b) I once read that I have to add 5 spaces at the end of a text so that the next line is indented. This has worked flawlessly so far.
c) In this example there are spaces at the end (see yellow mark). I deleted these spaces as a test and pasted the copied text into webtrees. But that had no effect on the formatting.


www.verwandten.info / PHP-Version 8.2 / webtrees 2.1.21

Please Log in or Create an account to join the conversation.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
2 years 8 months ago #10 by Bogie
Replied by Bogie on topic Markdown formatting
Same here.
I removed the double spaces before line break in my example above as a test.
The outcome was absolutely the same.
Hopefully I don't have to remove all double spaces again after my recent mass update.

Bogie
webtrees 2.1.22 | PHP 8.3.12 | MariaDB 10.11.8 | Apache on Ubuntu
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

Please Log in or Create an account to join the conversation.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
2 years 8 months ago #11 by Bogie
Replied by Bogie on topic Markdown formatting

> In my webtrees installation I did NOT even enable Markdown, but CONT tags are now concatenated without keeping the carriage return. I consider this a GEDCOM violation. And from my point of view it has nothing to do with Markdown.

That was a bug - and has been fixed for 2.0.18 and 2.1.0.

2.0.21 shows many more line breaks in text fields even without any double spaces before end of line.
Has that bug fix which came with 2.0.18 been reverted or even modified again?
Will there be another 2.0.x release which includes *all* corresponding changes which were made to 2.1.x?

Bogie
webtrees 2.1.22 | PHP 8.3.12 | MariaDB 10.11.8 | Apache on Ubuntu
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #12 by MarcoBorn
Replied by MarcoBorn on topic Markdown formatting
Is there still ay way to switch off all the Markdown and use the NOTE/CONT tags instead? I saw that sometimes they just get ignored. As we also exchange GEDCOM data with other researchers who don't use webtrees for us it makes not much sense to replace the Gedcom tags with something that only works with webtrees.

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #13 by fisharebest
Replied by fisharebest on topic Markdown formatting
You are asking in the 2.1 forum, so I guess you are talking about webtrees 2.1

As far as I know, all markdown formatting works correctly, and there are no issues with line breaks.
You can enable/disable markdown in: Control panel -> Family trees -> (your tree) -> Preferences -> Text formatting

Greg Roach - greg@subaqua.co.uk - @fisharebest@phpc.social - fisharebest.webtrees.net

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #14 by MarcoBorn
Replied by MarcoBorn on topic Markdown formatting
I forgot to mention the version I'm running. As 2.1 is Beta I use 2.022.

Please Log in or Create an account to join the conversation.

  • Bogie
  • Offline
  • Elite Member
  • Elite Member
  • Life is good!
More
2 years 7 months ago #15 by Bogie
Replied by Bogie on topic Markdown formatting
There was a small glitch in 2.0.21 and 2.0.22. Update to 2.0.23, please. That's the one that handles Markdown as it should.
In case you should see any issues could you provide an example, please.

Bogie
webtrees 2.1.22 | PHP 8.3.12 | MariaDB 10.11.8 | Apache on Ubuntu
AutoComplete places of @tkempf, chart modules of @magicsunday, Fancy treeview of @justCarmen

Please Log in or Create an account to join the conversation.

  • bertkoor
  • Offline
  • Platinum Member
  • Platinum Member
  • Greetings from Utrecht, Holland
More
2 years 7 months ago #16 by bertkoor
Replied by bertkoor on topic Markdown formatting
Marco was worried about raw text behaviour with Markdown disabled. CONC being concatenation, CONT being a new line.

Since Markdown formatting is switched on on the demo server, it's not easy to test.

stamboom.BertKoor.nl runs on webtrees v2.1.20

Please Log in or Create an account to join the conversation.

Powered by Kunena Forum