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

adding h-* to an e-* property loses the "html:" key #35

Closed
tantek opened this issue May 10, 2015 · 6 comments · Fixed by #42
Closed

adding h-* to an e-* property loses the "html:" key #35

tantek opened this issue May 10, 2015 · 6 comments · Fixed by #42

Comments

@tantek
Copy link
Member

tantek commented May 10, 2015

Compare how it parses:

<div class="h-entry"><div class="e-content"><p>Hello</p></div></div>

to how it parses:

<div class="h-entry"><div class="h-card e-content"><p>Hello</p></div></div>

Note that in the second example the "html:" key inside content is lost for no reason.

@tantek
Copy link
Member Author

tantek commented May 10, 2015

Expected result:

{
    "items": [
        {
            "type": [
                "h-entry"
            ],
            "properties": {
                "content": [
                    {
                        "type": [
                            "h-card"
                        ],
                        "properties": {
                            "name": [
                                "Hello"
                            ]
                        },
                        "html": "<p>Hello<\/p>",
                        "value": "Hello"
                    }
                ],
                "name": [
                    "Hello"
                ]
            }
        }
    ],
    "rels": {}
}

@kylewm
Copy link
Collaborator

kylewm commented May 10, 2015

What version of mf2py were you testing against? In the most recent (0.2.6) I get a slightly different result with html and value nested inside value. I'll revisit the spec.

{
  "items": [
    {
      "properties": {
        "content": [
          {
            "properties": {
              "name": [
                "Hello"
              ]
            },
            "type": [
              "h-card"
            ],
            "value": {
              "html": "<p>Hello</p>",
              "value": "Hello"
            }
          }
        ],
        "name": [
          "Hello"
        ]
      },
      "type": [
        "h-entry"
      ]
    }
  ],
  "rels": {}
}

https://kylewm.com/services/mf2?url=&doc=%3Cdiv+class%3D%22h-entry%22%3E%3Cdiv+class%3D%22h-card+e-content%22%3E%3Cp%3EHello%3C%2Fp%3E%3C%2Fdiv%3E%3C%2Fdiv%3E

@kevinmarks
Copy link
Member

me too: http://www.unmung.com/?html=%3Cdiv+class%3D%22h-entry%22%3E%3Cdiv+class%3D%22h-card+e-content%22%3E%3Cp%3EHello%3C%2Fp%3E%3C%2Fdiv%3E%3C%2Fdiv%3E&pretty=on

{
    "rels": {}, 
    "items": [
        {
            "type": [
                "h-entry"
            ], 
            "properties": {
                "content": [
                    {
                        "type": [
                            "h-card"
                        ], 
                        "properties": {
                            "name": [
                                "Hello"
                            ]
                        }, 
                        "value": {
                            "html": "<p>Hello</p>", 
                            "value": "Hello"
                        }
                    }
                ], 
                "name": [
                    "Hello"
                ]
            }
        }
    ], 
    "rel-urls": {}
}

@tantek
Copy link
Member Author

tantek commented May 10, 2015

I was using the live version of mf2py on Kartik's site - as documented in the wiki: http://microformats.org/wiki/microformats2#Python - I just now added KevinMarks's unmung textarea which he added after I filed this issue.

@kartikprabhu
Copy link
Member

@tantek updated my sites' mf2py. Now reproduces what @kylewm and @kevinmarks get. This value:value needs to be fixed somehow.

@kylewm
Copy link
Collaborator

kylewm commented May 11, 2015

@kartikprabhu, @tantek updated the spec to clarify the bit that I misunderstood. i.e., that we should fold "value" and "html" into the existing object instead of nesting a new object http://microformats.org/wiki/index.php?title=microformats2-parsing&diff=64955&oldid=64926&rcid=101331

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 a pull request may close this issue.

4 participants