Browse files

Making it clear that excerpting now no longer auto-escapes, but Sphin…

…x can do this for you.
  • Loading branch information...
1 parent cb86900 commit 5917f0f908ee20096bbc2f4cc41fe514a30741a3 @pat pat committed Jun 8, 2010
Showing with 17 additions and 0 deletions.
  1. +9 −0 ts/en/common_issues.textile
  2. +8 −0 ts/en/upgrading.textile
@@ -22,6 +22,7 @@ Depending on how you have Sphinx setup, or what database you're using, you might
* "Models outside of @app/models@":#external_models
* "Using Thinking Sphinx with Bundler":#bundler
* "Mixing Ranged Filters and OR Logic":#range_or
+* "Removing HTML from Excerpts":#escape_html
<h3 id="editconf">Editing the generated Sphinx configuration file</h3>
@@ -207,3 +208,11 @@ While Sphinx allows for querying with ranged filters on attributes, you can't ha
As a way around this, you might want to construct a SQL snippet which returns specific values for each range interval, and then filter by an array of values for the intervals you want. Check out "Tiago's solution on the Google Group":
This won't suit all situations, of course - if you don't have specific range intervals, then you're going to have to try something else.
+<h3 id="escape_html">Removing HTML from Excerpts</h3>
+For a while, Thinking Sphinx auto-escaped excerpts. However, Sphinx itself can remove HTML entities for indexing and excerpts, which is a better way to approach this. So, you'll want to add the following setting to your @sphinx.yml@ file:
+{% highlight yaml %}
+html_strip: true
+{% endhighlight %}
@@ -17,6 +17,14 @@ rake thinking_sphinx:version
If you're using an older version of Thinking Sphinx as a gem, then just look at the gem version number. If you've got it installed as a plugin, though, then you're going to have to have a look at @vendor/plugins/thinking_sphinx/lib/thinking_sphinx.rb@, as that's where the version number was stored.
+h3. Upgrading from between 1.3.6 and 1.3.17
+If you're using excerpts, for this set of versions they were automatically HTML-escaped. This is now no longer the case, as Sphinx can take care of this automatically for both indexing and excerpts. Just turn on the @html_strip@ value in your @sphinx.yml@ file:
+{% highlight yaml %}
+html_strip: true
+{% endhighlight %}
h3. Upgrading from between 1.3.3 and 1.3.7
You no longer have to specify an explicit Sphinx version when requiring Thinking Sphinx - it will figure it out itself. So, you can remove the version require statement from your @Rakefile@, and remove the version suffix in your gem setup in @environment.rb@.

0 comments on commit 5917f0f

Please sign in to comment.