[backend/federation] Add support for hubzilla's hashtag formatting
A bit strange but here we are
This commit is contained in:
parent
14720808db
commit
c3eacb34c2
1 changed files with 2 additions and 1 deletions
|
@ -157,7 +157,8 @@ public class NoteService(
|
||||||
// @formatter:off
|
// @formatter:off
|
||||||
var match = asNote.Tags?.OfType<ASHashtag>().Where(p => p.Name != null && p.Href != null) ?? [];
|
var match = asNote.Tags?.OfType<ASHashtag>().Where(p => p.Name != null && p.Href != null) ?? [];
|
||||||
//TODO: refactor this to use the nodes object instead of matching on text
|
//TODO: refactor this to use the nodes object instead of matching on text
|
||||||
text = match.Aggregate(text, (current, tag) => current.Replace($"[#{tag.Name!.TrimStart('#')}]({tag.Href})", $"#{tag.Name!.TrimStart('#')}"));
|
text = match.Aggregate(text, (current, tag) => current.Replace($"[#{tag.Name!.TrimStart('#')}]({tag.Href})", $"#{tag.Name!.TrimStart('#')}")
|
||||||
|
.Replace($"#[{tag.Name!.TrimStart('#')}]({tag.Href})", $"#{tag.Name!.TrimStart('#')}"));
|
||||||
// @formatter:on
|
// @formatter:on
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue