Searching html page source

12 views
Skip to first unread message

khw77

unread,
Feb 3, 2018, 9:27:38 AM2/3/18
to foxtrot-search
Hi - is there an option for searching an html file as text rather than in its rendered form? In other words, searching the html source code itself rather than how it appears in a browser?  
For example, if  I have a string <a href="example.com"> in an html file,  I would like to be able to search for "example" and show the html files in which it appears. FoxTrot Pro v6 doesn't seem to be able to do that.
Thanks, Keith

FoxTrot Engineering

unread,
Feb 3, 2018, 10:28:10 AM2/3/18
to foxtrot...@googlegroups.com
khw77 wrote:

>Hi - is there an option for searching an html file as text rather than in
>its rendered form?

No.

However, there is a hidden preference that allows *indexing* html in raw text form instead of rendered form. This implies that you won't be able to search rendered html text anymore. And this is a global option (and not a per index one).

To enable it, quit FoxTrot, copy and paste the two following lines to a Terminal.app window, then relaunch FoxTrot, and rebuild your index.

defaults write com.ctmdev.foxtrot Aliases -array-add \
"{type='html'; as='txt';}"

To reset the default behavior, copy and paste this command, and rebuild your index:

defaults delete com.ctmdev.FoxTrot Aliases


Jérôme - CTM Engineering


---------------------------------------------------------------------
"I searched for words inside text documents and was pleasantly surprised
when those words were highlighted in the respective text, if viewed in
the preview drawer."
FoxTrot Personal Search review on www.softpedia.com

Download a demo version from www.foxtrot.ch
---------------------------------------------------------------------



khw77

unread,
Feb 3, 2018, 3:02:00 PM2/3/18
to foxtrot-search
Many thanks for the quick reply and solution.  

It would be fantastic to have the option to search html as text on a per-index basis.  That way I could set up a separate indexes for rendered html and raw html.  Would you be able to give this some consideration please?
Reply all
Reply to author
Forward
0 new messages