markor icon indicating copy to clipboard operation
markor copied to clipboard

ShareInto: Pipe ("|") in text association breaks GitHub Markdown for links

Open RalphHightower opened this issue 1 year ago • 10 comments

⚠️ This issue respects the following points: ⚠️

  • [X] This is a bug. Not a question or feature request.
  • [X] The topic is not already reported at Issues. (I've searched it).
  • [X] Markor is up to date. See Releases for the latest version. Updates are available from F-Droid and GitHub.
  • [X] The bug is still present in the latest development version (git master). (Please download and try the test version of Markor, named Marder. Don't worry; Markor and Marder appear as completely separate applications. You can install both side-by-side, and Markor settings are not touched. In case the issue is resolved there, you don't need to create a bug report. The change will be part of the next Markor update.)

Description

The pipe in the descriptive text for links where the site name becomes part of the description breaks the GitHub Markdown for lins. Example of what would be from LiveScience: ArticleTitle / LiveScience. In the additional info/logs, I included a table that compares 2.12.2 to 2.11.0. V2.12.2 looks fine in Markor, but it breaks when uploaded to GitHub.

Steps to reproduce

  1. Google Chrome: goto https://www.livescience.com/stonehenge-england-ancient-history
  2. Click on the three horizontal dots on the top roght
  3. Copy the date "October 9, 2023" to the clipboard.
  4. Select "Share"
  5. Choose "Markor"
  6. Enter newline after the link for a blank line
  7. Paste the date on the blank line
  8. Copy to QuickLinks

Information

Android version: 14 (5.10.198-android12-9-28575149-abS908USQS5EXE2 #1 SMP PREEMPT Fri May 10 18:42:43 UTC 2024) Device: Samsung Galaxy S22 Ultra (samsung SM-S908U) App Version: v2.12.2

Source

Google Play

Format / File type

Markdown

Additional info / Log

I format the markdowns to add to tables. Below is a comparison of Markor versions. Table comparisons is on [RalphHightower/JekyllTestBed: Test Bed for Experimentation with Jekyll](https://github.com/RalphHightower/JekyllTestBed)

## Test to see if "|" inside text of link breaks the link.

| markor version | test | date |
|---|---|---|
| [Markor v2.11.0 (147\)](https://github.com/gsantner/markor/releases/tag/v2.11.0)[^21]  | [Where is Stonehenge, who built the prehistoric monument, and how? / Live Science](https://www.livescience.com/stonehenge-england-ancient-history) | October 9, 2023[^41] |
| [Markor v2.12.2 (code 151\)](https://github.com/gsantner/markor/releases/tag/v2.12.2)[^22] | [Where is Stonehenge, who built the prehistoric monument, and how? | Live Science](https://www.livescience.com/stonehenge-england-ancient-history) | October 9, 2023[^42] |

[^21]: \[Where is Stonehenge, who built the prehistoric monument, and how? / Live Science](https://www.livescience.com/stonehenge-england-ancient-history) \| October 9, 2023 \|<br />[Markor v2.11.0 (147\)](https://github.com/gsantner/markor/releases/tag/v2.11.0)

[^22]: \[Where is Stonehenge, who built the prehistoric monument, and how? \| Live Science](https://www.livescience.com/stonehenge-england-ancient-history) \| October 9, 2023 \|<br />[Markor v2.12.2 (code 151\)](https://github.com/gsantner/markor/releases/tag/v2.12.2)

[^41]: Success
[^42]: Failure

RalphHightower avatar May 26 '24 21:05 RalphHightower

What is the desired behaviour here? Is there a standard for how to format link text?

Is this something that should be a filed as a bug against github?

harshad1 avatar May 26 '24 22:05 harshad1

Prior to v2.12, Markor put a slash in between the text of the link that separates it from the Site name. V2.12 changed the separation character to a pipe, which wrecks havoc with forming properly formatted links. I added a screenshot of the web page that I'm experimenting with. I can work around how v2.12 and v2.11 differ by changing the pipe to a slash before incorporating the links before use.

Screenshot_20240526_231325_Chrome

RalphHightower avatar May 27 '24 03:05 RalphHightower

Ok. I see where this used to be

https://github.com/gsantner/markor/blob/v2.11.0/app/src/main/java/net/gsantner/markor/activity/DocumentShareIntoFragment.java#L421

I'll fix it soon.

harshad1 avatar May 27 '24 04:05 harshad1

Thank you.

RalphHightower avatar May 27 '24 04:05 RalphHightower

Is escaping the pipe sufficient? I.e. \|

harshad1 avatar May 27 '24 18:05 harshad1

That works; past precedence used /. Whichever way is best for the project.

RalphHightower avatar May 27 '24 20:05 RalphHightower

A potential "gotcha". For this particular link, https://www.colorado.edu/today/2024/04/29/new-star-about-appear-night-sky-heres-how-catch-glimpse, Markor outputs the descriptive text with two pipes.

2024-05-31: I changed the above from two links to two pipes.

| A new star is about to appear in the night sky. Here’s how to catch a glimpse | CU Boulder Today | University of Colorado Boulder | April 29, 2024 |

RalphHightower avatar May 28 '24 18:05 RalphHightower

This is now fixed in #2307

harshad1 avatar Jun 01 '24 06:06 harshad1

For reference. The pipe does not break links. It breaks table formatting in links. I am not sure if the 'fix' of replacing pipes with a slash is the right thing to do here.

Leaving this fix in as it was the historical behavior

harshad1 avatar Jun 04 '24 23:06 harshad1

Replacing pipe with slash and that in reformatted links only - sounds good. Having escaped pipe looks worse to me

gsantner avatar Jun 05 '24 00:06 gsantner