bcherry/twitter-text-js

splitTags doesn't work when there are '<' or '>' in tweet which are not part of any tag

Closed this issue · 3 comments

Input: Schöne Schriften -> http://bit.ly/Sdq0j
Output: Schöne Schriften -< >a href="http://bit.ly/Sdq0j"<http: bit.ly="" Sdq0j="">/a<</http:>

The output is generated by twttr.txt.autoLink method

< and > are always HTML-escaped in at Tweet-time, AFAIK. Is your input example a real Tweet? Otherwise, you'll have to HTML-escape the < and > before sending to auto-link.

Yup, escaping < and > first is the right solution here.