Closed NHQ closed 6 years ago
it looks like you are running the regexp over the raw data - it would be better to traverse the parsed js object and then test each thing. checkout ssb-msgs#links
https://github.com/ssbc/ssb-msgs/blob/master/index.js#L112-L120
does not this module work on strings of text?
@NHQ hmm I guess the links could be in markdown text... that isn't as bad... what kind of text are the links embedded in?
"data" is text, no matter what kind, markdown or plain. The new functions don't validate links, per se, they pluck them from texts. The intended use is between the textarea and the sbot post, for parsing plain texts and getting ssb links.
On Mon, Jan 18, 2016 at 1:04 PM, Dominic Tarr notifications@github.com wrote:
@NHQ https://github.com/NHQ hmm I guess the links could be in markdown text... that isn't as bad... what kind of text are the links embedded in?
— Reply to this email directly or view it on GitHub https://github.com/ssbc/ssb-ref/pull/6#issuecomment-172653401.
That seems reasonable. Im going to post some code-review comments
Also, needs some test cases
yes, add test cases and we'll merge
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
There was a bunch of functions of isTypeId
I needed _has_TypeID, to scan whole messages for link types.
I then added a set of functions to test links for the "tag" sigil:
#