question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue when delimiter's only inserted as text

See original GitHub issue
  • Markwon version: 4.3.1 See below things i am getting null when inserted # or * only in the text

input ‘#’ -> this should come as output # -> What i am getting is blank input ‘##’ -> this should come as output ## -> What i am getting is blank input ‘###’ -> this should come as output ### -> What i am getting is blank input ‘*’ -> this should come as output * -> What i am getting is blank input ‘1.’ -> this should come as output 1. -> What i am getting is blank input ‘>’ -> this should come as output > -> What i am getting is blank

This cases coming when user wants to just add * into text he doesn’t want to do bullet. Same thing for heading span.

is there any way i can handle this cases ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
notiescommented, May 8, 2020

Well, unfortunately this is works-as-inteded kind of thing. This library is based on commonmark specification with commonmark-java as parser implementation. And while I think that non-finished markdown sentences must not be turned into half-parsed results (which you see). This is how it is.

There was an issue here which I cannot find now. We have addressed this by checking if parsed markdown is empty and if it is -> raw markdown was used:

final String input = /*markdown input*/;
final Spanned spanned = markwon.toMarkdown(input);
// or maybe `TextUtils.getTrimmedLength(spanned) == 0` in your case
if (TextUtils.isEmpty(spanned)) {
    textView.setText(input);
} else {
    markwon.setParsedMarkdown(textView, spanned);
}
0reactions
notiescommented, May 12, 2020

This would be a bit problematic due to the stateless nature of parsing/rendering (and you have to memorize original markdown input). This seems like a reasonable default though, so maybe adding another setMarkdown method (with explicit fallbackToRawIfEmpty method argument) would be a better option

Read more comments on GitHub >

github_iconTop Results From Across the Web

Issues with Text to Column - Microsoft Community Hub
Insert enough columns to the right of the data column. Then untick the 'Treat consecutive delimiters as one' check box in the Text...
Read more >
Extraction with Text Between Delimiters not working
Solved: Hello, I am trying to extract full names for a column. The coulmn is in case table. I want to extract the...
Read more >
Issue with adding a delimiter at multiple positions in a fixed ...
Closed 2 years ago. I am trying to add delimiter in a fixed width text file at multiple positions given in a list...
Read more >
Using Text to Columns to Separate Data in a Single Column
Highlight the range of text to be separated. · Go to Data, Data Tools, Text to Columns. · Select Delimited from step 1...
Read more >
108 How to load data from CSV file that has extra delimiter
SSIS error: delimiter for column "columnX" is not found SSIS 2016 Flat File with Text Qualifier has a issue Can a custom file...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found