Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow prefixed @id attributes to allow internal linking #146

Merged
merged 1 commit into from May 6, 2011

Conversation

schuyler1d
Copy link
Contributor

@technoweenie
Copy link
Contributor

Nice. Since that's a nokogiri transformation, it should work across formats, right? What about links that point to them? Will they get the set prefix too?

@schuyler1d
Copy link
Contributor Author

Correct -- all formats should benefit.

As long as the links that point to them are of the standard form href="#foo" rather than href="localfile.html#foo" they should get transformed. My use-case there was particularly supporting textile footnotes which create both sides, and that's covered in one of the tests on the patch. Transforming the links is done here:

schuyler1d@c22050f#L0R65

technoweenie added a commit that referenced this pull request May 6, 2011
allow prefixed @id attributes to allow internal linking
@technoweenie technoweenie merged commit 1ff486e into gollum:master May 6, 2011
@technoweenie
Copy link
Contributor

Argh, I trusted you!

  1) Failure:
test_id_prefix_added(Markup)
    [./test/test_markup.rb:516:in `compare'
     ./test/test_markup.rb:481:in `test_id_prefix_added'
     /Users/technoweenie/.rvm/gems/ruby-1.8.7-p330/gems/mocha-0.9.12/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:22:in `__send__'
     /Users/technoweenie/.rvm/gems/ruby-1.8.7-p330/gems/mocha-0.9.12/lib/mocha/integration/test_unit/ruby_version_186_and_above.rb:22:in `run']:
<"<h2 id=\"wiki-foo\">xxxx<sup class=\"footnote\"><a href=\"#wiki-fn1\">1</a></sup></h2>\n<p class=\"footnote\" id=\"wiki-fn1\"><sup>1</sup> footnote</p>"> expected but was
<"<h2 id=\"wiki-foo\">xxxx<sup class=\"footnote\" id=\"wiki-fnr1\"><a href=\"#wiki-fn1\">1</a></sup></h2>\n<p class=\"footnote\" id=\"wiki-fn1\"><a href=\"#wiki-fnr1\"><sup>1</sup></a> footnote</p>">.

It's adding an ID to the sup tag. Probably an easy fix.

@schuyler1d
Copy link
Contributor Author

The bug is in the test. I must have an different version of RedCloth (mine is 4.2.7) which doesn't add an ID there. But, you'll notice the patch did the right thing with the footnote->context link as well, proving the patch works, anyway :-)

We can update the test to reflect your output, or I can make the test fuzzier (just do a regex on the important bits)

@technoweenie
Copy link
Contributor

Oh, it's linking to a footnote. Not a big deal, I can take a look when I have some time to integrate this into GitHub.

existme pushed a commit to existme/gollum that referenced this pull request Aug 9, 2018
allow prefixed @id attributes to allow internal linking
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants