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

Experimental language parsing #23

Closed
wants to merge 1 commit into from

Conversation

voxpelli
Copy link
Contributor

This is a test implementation of the brainstorm around parsing of languages at the Microformats wiki: http://microformats.org/wiki/microformats2-parsing-brainstorming#Parse_language_information

The tests are added here for now even though I know that they belong in a separate repository eventually if this brainstorm reaches a conclusion. For now its easier to keep it all in the same place.

For now this PR isn't ready to be merged but needs to await the conclusion of the brainstorm. Submitting it anyhow so there can be a place to discuss this experimental implementation.

This produces an output like what has been proposed in the wiki:

{
  "type": ["h-entry"],
  "lang": "se",
  "properties": {
    "name": ["En svensk titel"],
    "content": [
      {
        "lang": "en",
        "html": "With an <em>english</em> summary",
        "value": "With an english summary"
      },
      {
        "html": "Och <em>svensk</em> huvudtext",
        "value": "Och svensk huvudtext"
      }
    ]
  }
}

For an input like:

<div class="h-entry" lang="se">
  <h1 class="p-name">En svensk titel</h1>
  <div class="e-content" lang="en">With an <em>english</em> summary</div>
  <div class="e-content">Och <em>svensk</em> huvudtext</div>
</div>

This is a test implementation of the brainstorm around parsing of languages at the Microformats wiki: http://microformats.org/wiki/microformats2-parsing-brainstorming#Parse_language_information

The tests are added here for now even though I know that they belong in a separate repository eventually if this brainstorm reaches a conclusion. For now its easier to keep it all in the same place.
@glennjones
Copy link
Owner

I am closing this PR as the library has changed and the code for parsing is now in the microformat-shiv project. I have opened an issue there to add this

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

Successfully merging this pull request may close these issues.

2 participants