![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
github.com/willnorris/microformats
microformats is a go library and tool for parsing microformats, supporting both classic v1 and v2 syntax. It is based on Andy Leap's original library.
To see this package in action, the simplest way is to install the command line app and use it to fetch and parse a webpage with microformats on it:
% go install willnorris.com/go/microformats/cmd/gomf@latest
% gomf https://indieweb.org
To use it in your own code, import the package:
import "willnorris.com/go/microformats"
If you have the HTML contents of a page in an io.Reader, call Parse like in this example:
content := `<article class="h-entry"><h1 class="p-name">Hello</h1></article>`
r := strings.NewReader(content)
data := microformats.Parse(r, nil)
// do something with data, or just print it out as JSON:
enc := json.NewEncoder(os.Stdout)
enc.SetIndent("", " ")
enc.Encode(data)
Alternately, if you have already parsed the page and have an html.Node, then call ParseNode. For example, you might want to select a subset of the DOM, and parse only that for microformats. An example of doing this with the goquery package can be seen in cmd/gomf/main.go.
To see that in action using the gomf app installed above,
you can parse the microformats from indieweb.org that appear within the #content
element:
% gomf https://indieweb.org "#content"
{
"items": [
{
"id": "content",
"type": [
"h-entry"
],
"properties": ...
"children": ...
}
],
"rels": {},
"rel-urls": {}
}
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.