Zomis / Duga

Stack Exchange Chat bot
18 stars 6 forks source link

Markdown is not being picked up #101

Open ShipsWithCannons opened 9 years ago

ShipsWithCannons commented 9 years ago

code review is being detected. **code** review (and other constructions like that) is not.

Could support for such be added?

Thanks to Dan Pantry for spotting.

punmechanic commented 9 years ago

For posterity, this is my GH ;-)

punmechanic commented 9 years ago

Not sure how we detect it now, but this might solve at least bold/italics. Might want to add tokens for strikethroughs too

Vogel612 commented 9 years ago

@danpantry this only picks up that special markdown combination. It may be more feasible to just strip the markdown before analyzing, by dropping ---|([*_])+ from all comment bodies before running the fuzzy match

punmechanic commented 9 years ago

this only picks up that special markdown combination. but this might solve at least bold/italics.

You're right, of course. I just wonder whether it would be better to strip markdown instead of just ignoring it using regex.

Vogel612 commented 9 years ago

I feel like I am repeating myself..

https://github.com/Zomis/Duga/pull/84#discussion_r31601782

The better option to this might be stripping the comments of markdown before examining them, instead of building a comparably unreadable regex to match them with markdown

Vogel612 commented 9 years ago

Should be simple enough. A .replaceAll(/* insert above regex */, ""); before examining the comment body should be good to go. Add some clean test-cases. @Zomis do you know of any analyzers that check for markdown-specific stuff? If not it might be interesting to strip the markdown when parsing the API-Call

Zomis commented 9 years ago

Don't know of any analyzers that check for markdown-specific stuff. In the future though, I might want to take markdown into consideration when analyzing results from the API. I don't think that will ever happen for comments on posts though.