Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

made urls pass html validation by escaping ampersand

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
commit f5ffde304bb763e1adad07f92681d40c0ed216ef 1 parent 4f1c974
@kbrock kbrock authored josevalim committed
View
2  README
@@ -53,7 +53,7 @@ If you are not using Textmate as text editor, in your environment.rb or
in an initializer do:
if defined?(Footnotes)
- Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
+ Footnotes::Filter.prefix = 'txmt://open?url=file://%s&amp;line=%d&amp;column=%d'
end
Where you are going to choose a prefix compatible with your text editor. The %s is
View
2  lib/rails-footnotes/footnotes.rb
@@ -5,7 +5,7 @@ class Filter
@@klasses = []
# Default link prefix is textmate
- @@prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
+ @@prefix = 'txmt://open?url=file://%s&amp;line=%d&amp;column=%d'
# Edit notes
@@notes = [ :controller, :view, :layout, :stylesheets, :javascripts ]
View
10 test/footnotes_test.rb
@@ -70,11 +70,11 @@ def test_not_included_when_body_is_not_a_string
end
def test_footnotes_prefix
- assert_equal 'txmt://open?url=file://%s&line=%d&column=%d', Footnotes::Filter.prefix
- assert_equal 'txmt://open?url=file://file&line=0&column=0', Footnotes::Filter.prefix('file', 0, 0)
- assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', 10, 10)
- assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', 10, 10, 10)
- assert_equal 'txmt://open?url=file://file&line=10&column=10', Footnotes::Filter.prefix('file', '10', '10')
+ assert_equal 'txmt://open?url=file://%s&amp;line=%d&amp;column=%d', Footnotes::Filter.prefix
+ assert_equal 'txmt://open?url=file://file&amp;line=0&amp;column=0', Footnotes::Filter.prefix('file', 0, 0)
+ assert_equal 'txmt://open?url=file://file&amp;line=10&amp;column=10', Footnotes::Filter.prefix('file', 10, 10)
+ assert_equal 'txmt://open?url=file://file&amp;line=10&amp;column=10', Footnotes::Filter.prefix('file', 10, 10, 10)
+ assert_equal 'txmt://open?url=file://file&amp;line=10&amp;column=10', Footnotes::Filter.prefix('file', '10', '10')
end
def test_notes_are_initialized
View
2  test/notes/abstract_note_test.rb
@@ -63,7 +63,7 @@ def test_respond_to_has_fieldset?
def test_footnotes_prefix
Footnotes::Filter.prefix = ''
assert !@note.send(:prefix?)
- Footnotes::Filter.prefix = 'txmt://open?url=file://%s&line=%d&column=%d'
+ Footnotes::Filter.prefix = 'txmt://open?url=file://%s&amp;line=%d&amp;column=%d'
assert @note.send(:prefix?)
end
Please sign in to comment.
Something went wrong with that request. Please try again.