Skip to content
This repository has been archived by the owner on Nov 10, 2017. It is now read-only.

Commit

Permalink
Merge pull request #48 from mdn/obsolete_inline_1198762
Browse files Browse the repository at this point in the history
fix bug 1198762 - Handle {{obsolete_inline}}

+r groovecoder
  • Loading branch information
jwhitlock committed Sep 4, 2015
2 parents ab6b324 + 380d4bd commit 63f00c6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mdn/compatibility.py
Expand Up @@ -12,8 +12,8 @@
from .kumascript import (
CompatGeckoFxOS, CompatKumaScript, CompatNightly, CompatNo, CompatUnknown,
CompatVersionUnknown, DeprecatedInline, ExperimentalInline, KumaScript,
KumaVisitor, NonStandardInline, NotStandardInline, PropertyPrefix,
kumascript_grammar_source)
KumaVisitor, NonStandardInline, NotStandardInline, ObsoleteInline,
PropertyPrefix, kumascript_grammar_source)
from .utils import is_new_id, format_version, join_content
from .visitor import Extractor

Expand Down Expand Up @@ -483,6 +483,8 @@ def process(self, cls, node, **kwargs):
self.add_issue('footnote_feature', processed)
elif isinstance(processed, DeprecatedInline):
self.obsolete = True
elif isinstance(processed, ObsoleteInline):
self.obsolete = True
elif isinstance(processed, ExperimentalInline):
self.experimental = True
elif isinstance(processed, (NonStandardInline, NotStandardInline)):
Expand Down
7 changes: 7 additions & 0 deletions mdn/kumascript.py
Expand Up @@ -618,6 +618,12 @@ class NotStandardInline(KnownKumaScript):
expected_scopes = set(('compatibility feature',))


class ObsoleteInline(KnownKumaScript):
# https://developer.mozilla.org/en-US/docs/Template:obsolete_inline
canonical_name = 'obsolete_inline'
expected_scopes = set(('compatibility feature',))


class PropertyPrefix(KnownKumaScript):
# https://developer.mozilla.org/en-US/docs/Template:property_prefix
min_args = max_args = 1
Expand Down Expand Up @@ -749,6 +755,7 @@ def _visit_multi_token(self, node, children):
'geckoRelease': GeckoRelease,
'non-standard_inline': NonStandardInline,
'not_standard_inline': NotStandardInline,
'obsolete_inline': ObsoleteInline,
'property_prefix': PropertyPrefix,
'xref_csslength': XrefCSSLength,
}
Expand Down
8 changes: 8 additions & 0 deletions mdn/tests/test_compatibility.py
Expand Up @@ -360,6 +360,14 @@ def test_ks_deprecated_inline(self):
self.assert_feature(
cell, feature_id, name, slug, canonical=True, obsolete=True)

def test_ks_obsolete_inline(self):
# https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API
cell = 'Version -76 support {{obsolete_inline}}'
feature_id = '_version -76 support'
name = 'Version -76 support'
slug = 'web-css-background-size_version_-76_support'
self.assert_feature(cell, feature_id, name, slug, obsolete=True)

def test_ks_htmlelement(self):
cell = '{{ HTMLElement("progress") }}'
feature_id = '_progress'
Expand Down

0 comments on commit 63f00c6

Please sign in to comment.