Question Markdown formatting
- otmar.mayr
- Topic Author
- Offline
- Senior Member
www.verwandten.info / PHP-Version 8.2 / webtrees 2.1.21
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
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
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
Please Log in or Create an account to join the conversation.
- Bogie
- Offline
- Elite Member
- Life is good!
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:
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.
- ric2015
- Offline
- Senior Member
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
- Life is good!
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.
- fisharebest
- Offline
- Administrator
> 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.
- ric2015
- Offline
- Senior Member
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
> > 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
- Life is good!
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
- Life is good!
> 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.
- MarcoBorn
- Offline
- New Member
- Posts: 15
Please Log in or Create an account to join the conversation.
- fisharebest
- Offline
- Administrator
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.
- MarcoBorn
- Offline
- New Member
- Posts: 15
Please Log in or Create an account to join the conversation.
- Bogie
- Offline
- Elite Member
- Life is good!
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
- Greetings from Utrecht, Holland
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.