Hi, I have added this feature in my auto-link branch https://github.com/sagarun/askbot-devel/commits/auto-link . Currently it processes only one regex and autolinks to an specified URL in settings UI. I am wondering about processing multiple regex's and URLS. Can i ask the user to specify the regex's and URLs in comma separated form in settings UI? Appreciate your suggestions :-)
sagarun ( 2011-09-18 08:58:02 -0500 )edit@sagarun, looks great, I have a suggestion too - to support multiple patterns change the field to LongStringValue (or whichever allows multiline input) and then ask people to give one pattern/regex per line. And on save - validate the input:
- numbers of lines must match in both fields
- regexes should parse without errors
The live settings file supports input validation via an optional parameter update_callback, take a look at askbot/deps/livesettings/values.py to see how update callback is used... actually I am not 100% sure that proper custom validation can be done in livesettings.