Closed mctaylorpants closed 1 year ago
I've currently got two test failures in the suite - I can look into them further if the overall feature looks good:
TestFiles#test_/usr/src/app/test/testcases/block/04_header/with_header_links_text_to_html [/usr/src/app/test/test_files.rb:60]:
--- expected
+++ actual
@@ -16,7 +16,7 @@
<h2 id=\"hallo-2\"><a href=\"#hallo-2\">hallO</a></h2>
-<h1>Header without ID</h1>
+<h1><a href=\"#\">Header without ID</a></h1>
<h1 id=\"transliterated-day-la-vi-du\"><a href=\"#transliterated-day-la-vi-du\">Transliterated: Đây-là-ví-dụ</a></h1>
TestFiles#test_whether_Html_modifies_tree_with_file_/usr/src/app/test/testcases/block/04_header/with_header_links_text [/usr/src/app/test/test_files.rb:284]:
type mismatch.
Expected: :text
Actual: :a
Thanks for the comments and suggestions, @gettalong! I've made some updates:
auto_ids
, and just checks for the presence of an ID instead.
Hello! I've implemented a feature that I hope would be a good fit for kramdown: the ability to add links to headers.
How it works
When the
header_links
option is set totrue
andauto_ids
is alsotrue
, headers will receive an anchor tag - just like the ones on a Github README page... becomes:
Having a link in the header is handy for generating a permalink to share when there's no table of contents on the page.