Since the formatters return a Markup, perhaps a quick workaround would be to use something like Markup's stripentities() and striptags() to get the "raw" text back?
-- matevz On 14. Feb, 2013, at 15:33, Gary Martin wrote: > On 14/02/13 12:18, Andrej Golcov wrote: >> HI, >> >> Branko suggested to strip wiki syntax from Bloodhound Search results >> that is IMHO quite reasonable suggestion. That featue will give us >> better search scoring and better highlighting. >> >> I have one question regarding implementation of this feature. >> I far as I can see, existing formatters (e.g. trac.wiki.formatter.* >> classes) provide wiki to html formatting but not wiki to stripped >> text. Do I missed something? >> >> One of the possibility, that I see, is to convert wiki to html and >> than convert html to text. That does not look like the most optimal >> solution. >> >> Any alternatives, ideas? >> >> Regards, Andrej > > I should find out more about how the formatters work! My first thought would > be to look at creating a new formatter that strips out syntax but I am not > sure how big a job that will be. > > I don't mind seeing a sub-optimal solution, particularly if it is likely to > be quick enough and quick to create. I think that the double conversion would > be giving us the correct results - the rendered html must be considered what > the user will want to be able to search, right? > > Cheers, > Gary
