Skip to content

Commit

Permalink
Merge pull request #741 from gjtorikian/hash-to-self
Browse files Browse the repository at this point in the history
moderately improved hash detection
  • Loading branch information
gjtorikian authored Jul 26, 2022
2 parents 54358c4 + c4ef4be commit 7170a94
Show file tree
Hide file tree
Showing 5 changed files with 747 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/html_proofer/attribute/url.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def to_s

def known_extension?
return true if hash_link?
return true if path.end_with?("/")

ext = File.extname(path)

Expand Down Expand Up @@ -203,6 +204,10 @@ def hash_link?
url.start_with?("#")
end

def has_hash?
url.include?("#")
end

def param_link?
url.start_with?("?")
end
Expand Down
1 change: 1 addition & 0 deletions lib/html_proofer/url_validator/internal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ def run_internal_link_checker(links)

# prevents searching files we didn't ask about
return false unless url.known_extension?
return false unless url.has_hash?

decoded_href_hash = Addressable::URI.unescape(href_hash)
fragment_ids = [href_hash, decoded_href_hash]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!doctype html><html lang=en>
<body>
<span class="dot-sep meta-hover"></span><abbr title="Internal post ID" class=meta-hover>0291</abbr></p><article class=blog-post-single><div class=row><div class=col-md-9><section class=blog-post-content><p>I&rsquo;ve been able to pay a bit more attention to the Sound Switcher Indicator and implement some of the long asked-for features.</p><h2 id=whats-new>What&rsquo;s new</h2><ul><li><p><strong>Version 2.1.0</strong> (2016-09-29)</p><ul><li>Added support for configuration file (<a href=https://github.com/yktoo/indicator-sound-switcher/issues/30>#30</a>).<br>See <a href=/en/blog/post/2016/09/30-2.1.0/#config-file class=internal title="Sound Switcher Indicator ‣ 2.1.0">below</a> for details about its format.</li><li>The sections <code>Inputs</code> and <code>Outputs</code> can be hidden now (<a href=https://github.com/yktoo/indicator-sound-switcher/issues/32>#32</a>).</li><li>Device and port names can now be configured (<a href=https://github.com/yktoo/indicator-sound-switcher/issues/31>#31</a>).</li><li>Unused ports can be blacklisted (hidden from the menu) (<a href=https://github.com/yktoo/indicator-sound-switcher/issues/13>#13</a>).</li><li>French translation added.</li></ul></li><li><p><strong>Version 2.0.2</strong> (2016-09-28)</p><ul><li>The menu can now be localised (<a href=https://github.com/yktoo/indicator-sound-switcher/issues/28>#28</a>).<br>I&rsquo;ve made use of the standard localisation library <a href=https://www.gnu.org/software/gettext/>GNU gettext</a>. New translations can easily be added as <code>.po</code> files, and merged from pull requests.</li><li>Russian and Spanish translations added.</li><li>Added a manpage (<a href=https://github.com/yktoo/indicator-sound-switcher/issues/24>#24</a>).<br>It can be viewed using <code>man indicator-sound-switcher</code> (there&rsquo;s not much information yet, but at least it&rsquo;s there).</li></ul></li></ul><h2 id=config-file>The configuration file</h2><p>The configuration file, by default <code>~/.config/indicator-sound-switcher.json</code>, must be in the <a href=https://en.wikipedia.org/wiki/JSON class=wikipedia lang=en>JSON</a> format. The file is optional, and so are all its values.</p><p>Here&rsquo;s a sample config taken from the <a href=https://github.com/yktoo/indicator-sound-switcher/blob/master/README.md>README</a>:</p><div class=highlight><pre tabindex=0 style=background-color:#f8f8f8;-moz-tab-size:4;-o-tab-size:4;tab-size:4><code class=language-json data-lang=json><span style=display:flex><span><span style=color:#000;font-weight:700>{</span>


</body>
</html>
Loading

0 comments on commit 7170a94

Please sign in to comment.