Skip to content

Commit

Permalink
Find URLs before markdown
Browse files Browse the repository at this point in the history
This should fix _ in URLs.
  • Loading branch information
zapek committed Jan 19, 2025
1 parent 4555908 commit 4366ec9
Showing 1 changed file with 23 additions and 2 deletions.
25 changes: 23 additions & 2 deletions ui/src/main/java/io/xeres/ui/support/markdown/MarkdownService.java
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
/*
* Copyright (c) 2025 by David Gerber - https://zapek.com
*
* This file is part of Xeres.
*
* Xeres is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Xeres is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Xeres. If not, see <http://www.gnu.org/licenses/>.
*/

package io.xeres.ui.support.markdown;

import io.xeres.ui.support.contentline.Content;
Expand Down Expand Up @@ -41,11 +60,13 @@ public MarkdownService(EmojiService emojiService)
lineDetectors.add(new HeaderDetector());
lineDetectors.add(new CodeIndentDetector());

substringDetectors.add(new CodeDetector());
substringDetectors.add(new EmphasisDetector());
substringDetectors.add(new LinkDetector());
substringDetectors.add(new HrefDetector());
substringDetectors.add(new UrlDetector());

substringDetectors.add(new CodeDetector());
substringDetectors.add(new EmphasisDetector());

substringDetectors.add(new ImageDetector());
if (emojiService.isColoredEmojis())
{
Expand Down

0 comments on commit 4366ec9

Please sign in to comment.