ssbc / ssb-ref

check if a string is a valid ssb-reference
MIT License
14 stars 10 forks source link

I added .has functions, and added .is and .has functions for ```#``` #6

Closed NHQ closed 6 years ago

NHQ commented 8 years ago

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: #

pfrazee commented 8 years ago

Related: https://github.com/ssbc/secure-scuttlebutt/pull/135

dominictarr commented 8 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

NHQ commented 8 years ago

does not this module work on strings of text?

dominictarr commented 8 years ago

@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?

NHQ commented 8 years ago

"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.

pfrazee commented 8 years ago

That seems reasonable. Im going to post some code-review comments

pfrazee commented 8 years ago

Also, needs some test cases

dominictarr commented 8 years ago

yes, add test cases and we'll merge

stale[bot] commented 6 years ago

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.