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

How to remove the img tag from p-content #56

Open
aaronpk opened this issue Jan 12, 2018 · 1 comment
Open

How to remove the img tag from p-content #56

aaronpk opened this issue Jan 12, 2018 · 1 comment
Labels

Comments

@aaronpk
Copy link
Owner

aaronpk commented Jan 12, 2018

Part of #52.

When the original HTML uses p-content that contains a u-photo inside, the mf2 parser strips out the HTML completely, returning a plaintext string for content that doesn't contain an img tag at all. XRay has no way to remove the image from the content.

HTML

<html>
  <head>
    <title>Test</title>
  </head>
  <body class="h-entry">
    <p class="p-content p-name">This is a photo post with an <code>img</code> tag inside the content. <img class="u-photo" src="http://target.example.com/photo.jpg"></p>
  </body>
</html>

mf2 json

        {
            "type": [
                "h-entry"
            ],
            "properties": {
                "content": [
                    "This is a photo post with an img tag inside the content. http://target.example.com/photo.jpg"
                ],
                "name": [
                    "This is a photo post with an img tag inside the content. http://target.example.com/photo.jpg"
                ],
                "photo": [
                    "http://target.example.com/photo.jpg"
                ]
            }
        }

https://pin13.net/mf2/?id=20180112195016745

@aaronpk
Copy link
Owner Author

aaronpk commented Jan 12, 2018

I have no idea what the correct thing to do here is. Any ideas @tantek?

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

No branches or pull requests

1 participant