Merge pull request #455 from FineFindus/fix/quote=whitespace
fix(StatusDisplayItem/Quote): allow whitespace in closing br tag
This commit is contained in:
@@ -86,7 +86,7 @@ public abstract class StatusDisplayItem{
|
|||||||
public static final int FLAG_NO_MEDIA_PREVIEW=1 << 8;
|
public static final int FLAG_NO_MEDIA_PREVIEW=1 << 8;
|
||||||
|
|
||||||
|
|
||||||
private final static Pattern QUOTE_MENTION_PATTERN=Pattern.compile("(?:<p>)?\\s?(?:RE:\\s?(<br\\/?>)?)?<a href=\"https:\\/\\/[^\"]+\"[^>]*><span class=\"invisible\">https:\\/\\/<\\/span><span class=\"ellipsis\">[^<]+<\\/span><span class=\"invisible\">[^<]+<\\/span><\\/a>(?:<\\/p>)?$");
|
private final static Pattern QUOTE_MENTION_PATTERN=Pattern.compile("(?:<p>)?\\s?(?:RE:\\s?(<br\\s?\\/?>)?)?<a href=\"https:\\/\\/[^\"]+\"[^>]*><span class=\"invisible\">https:\\/\\/<\\/span><span class=\"ellipsis\">[^<]+<\\/span><span class=\"invisible\">[^<]+<\\/span><\\/a>(?:<\\/p>)?$");
|
||||||
private final static Pattern QUOTE_PATTERN=Pattern.compile("[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$");
|
private final static Pattern QUOTE_PATTERN=Pattern.compile("[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)$");
|
||||||
|
|
||||||
public void setAncestryInfo(
|
public void setAncestryInfo(
|
||||||
@@ -280,9 +280,6 @@ public abstract class StatusDisplayItem{
|
|||||||
Matcher matcher=QUOTE_MENTION_PATTERN.matcher(status.content);
|
Matcher matcher=QUOTE_MENTION_PATTERN.matcher(status.content);
|
||||||
if(matcher.find()){
|
if(matcher.find()){
|
||||||
String quoteMention=matcher.group();
|
String quoteMention=matcher.group();
|
||||||
// FIXME: This is ugly. I wanna do it all in the regex >:(
|
|
||||||
if(statusForContent.content.contains("RE:<br />"+quoteMention))
|
|
||||||
quoteMention = "RE:<br />"+quoteMention;
|
|
||||||
statusForContent.content=statusForContent.content.replace(quoteMention, "");
|
statusForContent.content=statusForContent.content.replace(quoteMention, "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user