heyy there
I want to parse the text, I will call it "post" and "urlize" some lines if they contain a specific character in a certain position.
my "pseudo-code" will look like this:
def urlize(post)
for string in post
if string icontains ('#')
url=(r'^searchn/$',
searchn,
name='news_searchn'),
then apply url to the string
return urlize(post)
I want the function to return me a message with urlized strings where necessary (just like twitter).
I don’t understand: how can I parse the text and search for specific lines? is it ok to make a function, especially for "urlizing" some lines? The function should return the entire post, regardless of whether it has such lines. is there any other way that django offers? Thanks you