mirror of
https://github.com/GitJournal/GitJournal.git
synced 2025-06-25 16:19:58 +08:00
StripMarkdownFormatting: Only consider '* ' as lists
If we let the space be optional then this picks up bold/italics as well. Ideally, the stripMarkdown formatting could be made smarter, but I would prefer to just rid of it in the future, and use the proper markdown parser. The only thing that is stopping me right now is performance. So in the future when the stripped version is cached, this should be fine. Fixes #420
This commit is contained in:
@ -27,15 +27,15 @@ String replaceMarkdownChars(String line) {
|
||||
line = line.replaceFirst('- [x]', '☑');
|
||||
line = line.replaceFirst('- [X]', '☑');
|
||||
|
||||
line = replaceListChar(line, '*');
|
||||
line = replaceListChar(line, '-');
|
||||
line = replaceListChar(line, '+');
|
||||
line = replaceListChar(line, '* ');
|
||||
line = replaceListChar(line, '- ');
|
||||
line = replaceListChar(line, '+ ');
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
String replaceListChar(String line, String char) {
|
||||
const String bullet = '•';
|
||||
const String bullet = '• ';
|
||||
|
||||
var starPos = line.indexOf(char);
|
||||
if (starPos == 0) {
|
||||
|
Reference in New Issue
Block a user