Skip to content

Commit

Permalink
Use - for Markdown slugs instead of _ (#524)
Browse files Browse the repository at this point in the history
  • Loading branch information
zwaldowski committed Apr 14, 2016
1 parent 9eff21d commit a09996d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Master

##### Bug Fixes

* Uses GitHub-Flavored Markdown syntax for anchors when rendering README pages.
[Zachary Waldowski](https://github.com/zwaldowski)
[#524](https://github.com/realm/jazzy/issues/524)

## 0.6.0

##### Breaking
Expand Down
6 changes: 3 additions & 3 deletions lib/jazzy/jazzy_markdown.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ class JazzyHTML < Redcarpet::Render::HTML
include Rouge::Plugins::Redcarpet

def header(text, header_level)
text_slug = text.gsub(/[^a-zA-Z0-9]+/, '_')
text_slug = text.gsub(/[^\w]+/, '-')
.downcase
.sub(/^_/, '')
.sub(/_$/, '')
.sub(/^-/, '')
.sub(/-$/, '')

"<a href='##{text_slug}' class='anchor' aria-hidden=true>" \
'<span class="header-anchor"></span>' \
Expand Down
2 changes: 1 addition & 1 deletion spec/integration_specs
Submodule integration_specs updated 22 files
+50 −50 document_alamofire/after/docs/docsets/Alamofire.docset/Contents/Resources/Documents/index.html
+50 −50 document_alamofire/after/docs/index.html
+4 −4 document_moya_podspec/after/docs/docsets/Moya.docset/Contents/Resources/Documents/index.html
+4 −4 document_moya_podspec/after/docs/index.html
+3 −3 document_realm_objc/after/docs/Classes.html
+1 −1 document_realm_objc/after/docs/Classes/RLMArray.html
+2 −2 document_realm_objc/after/docs/Classes/RLMObject.html
+3 −3 document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/Classes.html
+1 −1 document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/Classes/RLMArray.html
+2 −2 document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/Classes/RLMObject.html
+5 −5 document_realm_objc/after/docs/docsets/Realm.docset/Contents/Resources/Documents/index.html
+5 −5 document_realm_objc/after/docs/index.html
+1 −1 document_realm_swift/after/docs/Classes.html
+1 −1 document_realm_swift/after/docs/Classes/Object.html
+3 −3 document_realm_swift/after/docs/Typealiases.html
+1 −1 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Classes.html
+1 −1 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Classes/Object.html
+3 −3 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/Typealiases.html
+5 −5 document_realm_swift/after/docs/docsets/RealmSwift.docset/Contents/Resources/Documents/index.html
+5 −5 document_realm_swift/after/docs/index.html
+13 −13 document_siesta/after/api-docs/docsets/Siesta.docset/Contents/Resources/Documents/index.html
+13 −13 document_siesta/after/api-docs/index.html

0 comments on commit a09996d

Please sign in to comment.