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

Ignore caniuse links that point to w3.org #14

Closed
zcorpan opened this issue Jan 25, 2016 · 1 comment
Closed

Ignore caniuse links that point to w3.org #14

zcorpan opened this issue Jan 25, 2016 · 1 comment

Comments

@zcorpan
Copy link
Member

zcorpan commented Jan 25, 2016

See Fyrd/caniuse#2232

function URLToID(const SpecURL: UTF8String; out ID: UTF8String): Boolean;
var
   HashIndex: Cardinal;
begin
   ID := '';
   Result := True;
   if ((Pos('http://www.w3.org/TR/html51/', SpecURL) = 1) or
       (Pos('http://www.w3.org/TR/html5/', SpecURL) = 1) or
       (Pos('http://www.w3.org/TR/html/', SpecURL) = 1) or
       (Pos('http://www.w3.org/html/wg/drafts/html/master/', SpecURL) = 1) or
       (Pos('http://dev.w3.org/html5/spec/', SpecURL) = 1) or
       (Pos('http://www.w3.org/TR/2011/WD-html5-20110525/', SpecURL) = 1) or
       (Pos('http://www.w3.org/TR/2014/PR-html5-20140916/', SpecURL) = 1) or
       (Pos('http://www.w3.org/TR/workers/', SpecURL) = 1) or
       (Pos('http://www.w3.org/TR/webstorage/', SpecURL) = 1) or
       (Pos('http://www.w3.org/TR/webmessaging/', SpecURL) = 1) or
       (Pos('https://html.spec.whatwg.org/', SpecURL) = 1) or
       (Pos('https://www.whatwg.org/specs/web-apps/current-work/', SpecURL) = 1) or
       (Pos('http://www.whatwg.org/specs/web-apps/current-work/', SpecURL) = 1) or
       (Pos('https://whatwg.org/specs/web-apps/current-work/', SpecURL) = 1) or
       (Pos('http://whatwg.org/specs/web-apps/current-work/', SpecURL) = 1)) then

We should ignore anything but https://html.spec.whatwg.org/ and make sure caniuse links to that where appropriate, if it doesn't already.

@zcorpan
Copy link
Member Author

zcorpan commented Jan 25, 2016

diff --git a/src/wattsi.pas b/src/wattsi.pas
index 533ed11..72e0470 100644
--- a/src/wattsi.pas
+++ b/src/wattsi.pas
@@ -2018,6 +2018,8 @@ begin
          else
             Feature.Reset();
          Feature.CanIUseCode := FeatureCode;
+         if (Pos('https://html.spec.whatwg.org/', SpecURL) <> 1) then
+            Writeln('Caniuse non-whatwg link: ', SpecURL, ' ', FeatureCode);
          for BrowserIndex in TBrowserIndex do
          begin
             Feature.FirstGoodVersion[BrowserIndex].Version := '';

->

Processing caniuse.com data...
Caniuse non-whatwg link: http://www.w3.org/TR/webmessaging/#channel-messaging channel-messaging
Caniuse non-whatwg link: http://www.w3.org/TR/webstorage/#storage namevalue-storage
Caniuse non-whatwg link: http://www.w3.org/TR/websockets/ websockets
Caniuse non-whatwg link: http://www.w3.org/TR/xhtml1/ xhtml
Caniuse non-whatwg link: http://www.w3.org/TR/eventsource/ eventsource
Caniuse non-whatwg link: http://www.w3.org/TR/MathML/ mathml

Should probably keep this

   if (SpecURL = 'http://www.w3.org/TR/MathML/') then
   begin
      ID := 'mathml';
   end

However URLToID is used by URLs from bugzilla also, which we probably want to keep as is for now...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant