diff --git a/lib/referator/reference.rb b/lib/referator/reference.rb index d775314..d15aa2f 100644 --- a/lib/referator/reference.rb +++ b/lib/referator/reference.rb @@ -12,17 +12,13 @@ module Referator end def to_h - @to_h ||= data.merge(category:, id:, slug:, anchor:, fragment:).freeze + @to_h ||= data.merge(category:, id:, slug:, anchor:).freeze end def anchor @anchor ||= "#{category}-#{slug}".freeze end - def fragment - @fragment ||= "##{anchor}".freeze - end - private def category=(category) diff --git a/test.rb b/test.rb index 8623222..2b541a9 100755 --- a/test.rb +++ b/test.rb @@ -43,21 +43,17 @@ REFS = { self: { foo: RAW_REFS[:self][:foo].merge( 'anchor' => 'self-blog-foo', - 'fragment' => '#self-blog-foo', ).freeze, bar: RAW_REFS[:self][:bar].merge( 'anchor' => 'self-blog-bar', - 'fragment' => '#self-blog-bar', ).freeze, }.freeze, link: { example_com: RAW_REFS[:link][:example_com].merge( 'anchor' => 'link-example-com', - 'fragment' => '#link-example-com', ).freeze, causa_arcana_com: RAW_REFS[:link][:causa_arcana_com].merge( 'anchor' => 'link-causa-arcana-com', - 'fragment' => '#link-causa-arcana-com', ).freeze, }.freeze, }.freeze @@ -256,7 +252,6 @@ cmd :RENDER_FOOTNOTES, :json do |result| "id": "/blog/foo", "slug": "blog-foo", "anchor": "self-blog-foo", - "fragment": "#self-blog-foo", "url": "/blog/foo.html", "text": "Foo" }, @@ -266,7 +261,6 @@ cmd :RENDER_FOOTNOTES, :json do |result| "id": "/blog/bar", "slug": "blog-bar", "anchor": "self-blog-bar", - "fragment": "#self-blog-bar", "url": "/blog/bar.html", "text": "Bar" } @@ -278,7 +272,6 @@ cmd :RENDER_FOOTNOTES, :json do |result| "id": "example_com", "slug": "example-com", "anchor": "link-example-com", - "fragment": "#link-example-com", "url": "https://example.com", "text": "Example Domain" }, @@ -288,7 +281,6 @@ cmd :RENDER_FOOTNOTES, :json do |result| "id": "causa_arcana_com", "slug": "causa-arcana-com", "anchor": "link-causa-arcana-com", - "fragment": "#link-causa-arcana-com", "url": "https://causa-arcana.com", "text": "Causa Arcana" } diff --git a/test/footnotes.json.erb b/test/footnotes.json.erb index 89cec12..d8c6b0c 100644 --- a/test/footnotes.json.erb +++ b/test/footnotes.json.erb @@ -7,7 +7,6 @@ "id": <%= String(note['id']).to_json %>, "slug": <%= String(note['slug']).to_json %>, "anchor": <%= String(note['anchor']).to_json %>, - "fragment": <%= String(note['fragment']).to_json %>, "url": <%= "#{note['id']}.html".to_json %>, "text": <%= String(note['text']).to_json %> }<%= ',' unless index == notes['self'].count - 1 %> @@ -21,7 +20,6 @@ "id": <%= String(note['id']).to_json %>, "slug": <%= String(note['slug']).to_json %>, "anchor": <%= String(note['anchor']).to_json %>, - "fragment": <%= String(note['fragment']).to_json %>, "url": <%= String(note['url']).to_json %>, "text": <%= String(note['text']).to_json %> }<%= ',' unless index == notes['link'].count - 1 %>