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

Paragraph tags stripped from post text #86

Open
manton opened this issue Aug 24, 2020 · 6 comments
Open

Paragraph tags stripped from post text #86

manton opened this issue Aug 24, 2020 · 6 comments
Milestone

Comments

@manton
Copy link
Contributor

manton commented Aug 24, 2020

Sunlit does some processing on the HTML and (I think) in the process strips out some <p> tags that are important parts of the formatting. I don't think we should change this for 3.0 because it risks breaking other things, but maybe shortly after.

@paulrobertlloyd
Copy link
Contributor

Might this work as a solution for providing both types:

"content": [{
    "html":"<p>Tuneresque</p><p><img src=\"https://getindiekit.github.io/sandbox/media/photos/2020/08/30/8u53c.jpg\" width=\"600\" height=\"839\" alt=\"Dramatic sunset over Brighton’s West Pier\" style=\"height: auto;\" class=\"sunlit_image\" /></p>",
    "value":"Tuneresque\n\n![Dramatic sunset over Brighton’s West Pier](https://getindiekit.github.io/sandbox/media/photos/2020/08/30/8u53c.jpg)"
}]

i.e. content.html uses HTML, context.value is Markdown (or perhaps what is currently provided?)

@manton
Copy link
Contributor Author

manton commented Sep 1, 2020

This issue is about how Sunlit processes text from the timeline API, so not directly related to Micropub or publishing.

@paulrobertlloyd
Copy link
Contributor

Shall I file a separate bug for this then?

@manton
Copy link
Contributor Author

manton commented Sep 1, 2020

Sure, feel free to file it. I don't think it's clear how best to handle this, because passing separate Markdown-only text (without any HTML tags) will lose some data since Markdown image references can't have width/height/class. So I'm leaning to not changing this for now until there's more feedback from other Micropub implementations. We always recommend that people enable Markdown processing for anything posted from Micro.blog or Sunlit.

@cheesemaker
Copy link
Collaborator

Moving this out to 3.2 because it isn't a simple/easy fix. The reason we strip the

tags in the first place is that the html renderer in iOS labels adds a ridiculous amount of whitespace to the bottom of the view.

@cheesemaker cheesemaker added this to the 3.2 milestone Sep 25, 2020
@cheesemaker
Copy link
Collaborator

cheesemaker commented Oct 13, 2020

This isn't going to make the cut for 3.2 mostly because I'm not sure exactly how this should be solved.

To be honest, I'm not sure it's actually a bug or more of a preference. We're never going to keep all html formatting in the Sunlit feed simply because that's not how it was designed to work. It was a conscious decision to strip the <p> tags because of how NSAttributedStrings (the widget we use to render) handles them. The best suggestion would be to use a <br> tag instead of a <p> tag.

@cheesemaker cheesemaker modified the milestones: 3.2, 3.4 Oct 13, 2020
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

No branches or pull requests

3 participants