Object definition of OGHref
This library provides structure of rich information link and parser from HTML documentations.
Usages
Import dependencies
- Add
oghref_modelintopubspec.yamldependencies: oghref_model: # Latest stable version - Import package
import 'package:oghref_model/model.dart'; - If custom parser implementations required, please also import
buffer_parser.dartimport 'package:oghref_model/buffer_parser.dart';
Implementations
See example;
Limitations and restrictions
-
MetaFetchonly recognize the first property name prefix in a sequence of<meta>tag in<head>. For example, given a HTML file:<head> <meta property="og:title" content="Title"/> <meta property="twitter:card" content="summary"/> </head>In this case,
MetaFetchonly recognizeogprefix and remaining metadata will be ignored. If preferred to override the first property prefix recognization, please apply this setting inMetaFetch(in this case, Twitter Card):MetaFetch()..primaryPrefix = "twitter"; -
Unless for testing, URL response's content type must be satisified below:
text/htmlapplication/xhtml+xml
Otherwise,
MetaFetchrefuses to parse properties toMetaInfo. -
<meta>must be hard-coded in HTML, generated by JavaScript will be ignored.
License
AGPL 3.0 or later (For import dedicatedly)
MIT (For import with widgets)
Libraries
- buffer_parser
- Offering the classes for constructing custom parser on another protocol.
- model
- A basic library shipped with model, defined parser and fetch only for implementation.