You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For example, @else/url currently blocks type recognition of other URL-like types added after it is added, and it's added at initialisation. Already existing workarounds:
A general solution would be to create a separate category of parsers with generic types, to catch all leftovers. This would include all @else and @empty types. This could also warrant the creation of an entire category system for parsers, as there already is a separate system for native parsers.
The text was updated successfully, but these errors were encountered:
The Cite.parse.add() function will probably also change before v0.4.0, but that's for another day.
This will register @wikidata/url as a subclass of @else/url. If a given input matches @else/url, it will now first check if subclasses also match, and if they do, give it that type. Note that this assumes every form of input matching @wikidata/url also matches @else/url, i.e.:
If types (or rather the criteria in the type parsers) overlap, however, this wouldn't work.
In that case, I recommend making the type parser criteria more specific, if possible.
Note: Removing parsers (instead of stubbing them, like above) will also be possible.
I still have to figure out logic for what happens when a type is registered as extending a type that doesn't exist.
# Feature
- 'extends' type parsing option, to subclass
types (like @else/url -> @wikidata/api).
See #104
# Change
- Type parsers now go in a seperate 'parseType'
option
- Renamed 'parseType' predicate option to
'predicate'
# Refactoring
- Refactor the registering system
- Improve the backwards compat system
See #104, #106, #88
For example,
@else/url
currently blocks type recognition of other URL-like types added after it is added, and it's added at initialisation. Already existing workarounds:@else/url
forceType
option orCite.parse.data[Async]()
with the desired typeA general solution would be to create a separate category of parsers with generic types, to catch all leftovers. This would include all
@else
and@empty
types. This could also warrant the creation of an entire category system for parsers, as there already is a separate system for native parsers.The text was updated successfully, but these errors were encountered: