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

Feature request: Support for formatted post display #1459

Closed
imdatceleste opened this issue Jul 2, 2023 · 11 comments
Closed

Feature request: Support for formatted post display #1459

imdatceleste opened this issue Jul 2, 2023 · 11 comments
Labels
enhancement New feature or request

Comments

@imdatceleste
Copy link

Mastodon stores the toots in HTML if there is any format information (e.g. markdown from the glitch-soc fork).

Currently IceCubesApp only displays these toots in plain-text format, all formatting from the server are discarded.

It would be awesome, if it would display the posts formatted with HTML.

AFAIK, when posting a toot, it is sent in plaintext and depending on the server-configuration, the server then converts it to HTML if it detects any formatting (and the user has set it so on their server-profile in e.g. glitch-soc).

Thank you for your consideration.

@imdatceleste imdatceleste added the enhancement New feature or request label Jul 2, 2023
@ShadSterling
Copy link

Apparently there is some support for formatting; I'm seeing crossed out text in a port that doesn't have any formatting - https://mastodon.social/@glyph/110724377873612649

@imdatceleste
Copy link
Author

Apparently there is some support for formatting; I'm seeing crossed out text in a port that doesn't have any formatting - https://mastodon.social/@glyph/110724377873612649

This is a bug, IceCubesApp should not interpret markdown by itself.

If the user has set that they are posting Markdown or HTML (it is a setting in glitch-soc at the very least), Mastodon automatically parses the incoming plain-text as being in that format and converts it to HTML before storing it.

So, if IceCubesApp retrieves a toot-text from Mastodon-server, it should not do any additional parsing/interpreting. It should just support the display of HTML in the post-view.

@ShadSterling
Copy link

How can I distinguish whether the crossed-out text is something Ice Cubes added by interpreting the plain text or something Ice Cubes displayed from the HTML?

@imdatceleste
Copy link
Author

How can I distinguish whether the crossed-out text is something Ice Cubes added by interpreting the plain text or something Ice Cubes displayed from the HTML?

If you see it in IceCubesApp, then it means it is how it should be shown, no further interpretation.

Interpretation and conversion from Markdown to HTML is only done on the server. If the server returns a ˜text˜ then the tilde-symbols are to be shown and not interpreted in the client (note: I am using the "special" ˜ to avoid GitHub interpreting it).

So, rule:

  1. User types text with markdown. Client sends it to the server as PLAIN-TEXT format. Client does not interpret anything, does not convert anything. It sends it "raw" to the server.
  2. Server checks what settings the user has and depending on the settings, it either converts Markdown to HTML or leaves it as is.
  3. Client retrieves the result back from the server and displays what it gets from the server. If it is plain text, then client displays plain text. If it is HTML, client should display formatted text, but IceCubesApp doesn't do that atm.

@Dimillian
Copy link
Owner

Dimillian commented Jul 17, 2023

ATM Ice Cubes strip HTML for rendering. There is indeed a new set of allowed tag for bold etc... planning to support it once it's a bit more mainstream.

@imdatceleste
Copy link
Author

imdatceleste commented Jul 17, 2023

ATM Ice Cubes strip HTML for rendering. There is indeed a new set of allowed tag for bold etc... planning to support it once it's a bit more mainstream.

Yeah, that's what I thought. Thank you for your great work.

Just a heads-up: because of some (let's call them) "discussions" in Fediverse regarding Mastodon and where it might be heading, large instances are slowly switching to glitch-soc in case there is a need for a hard fork at some time.

This means that, hopefully, glitch-soc will become more and more mainstream as more admins are unhappy with Mastodon maintainer's decisions.

@ShadSterling
Copy link

So, if Ice Cubes retrieves the post and either displays plain text as-is or strips tags from HTML, how does crossed-out text ever appear? In particular, how does that happen in https://mastodon.social/@glyph/110720782356844143 ?
That post appears to be plain text in my (laptop) browser, but has crossed out text in Ice Cubes

@Dimillian
Copy link
Owner

It's a bug in Ice Cubes. Because of the UI framework the app is using, SwiftUI, the easiest way to render HTML text is to use the native Markdown renderer. So HTML is stripped, then it's converted to Markdown for final display. Some characters combinaison are interpreted as Markdown unfortunately and rendered as such.

@ShadSterling
Copy link

Ok. Is there an issue for that bug (that I can subscribe to), or does it belong in this feature request?

@Dimillian
Copy link
Owner

This one sound nice :)

@ShadSterling
Copy link

nathreed added a commit to nathreed/IceCubesApp that referenced this issue Nov 27, 2023
While SwiftUI's `Text` view won't display these in an `AttributedString` even if they get parsed from Markdown (which would also require the use of the `.full` option instead of the `.inlineOnlyPresrevingWhitespace` option), we can improve the appearance somewhat.
Currently, list elements are clumped together with no spaces between them, and there's no indication whatsoever that the author indicated these to be a list.
Change to insert Markdown list syntax with linebreaks and dashes, so users can at least understand there's a list there.
Similar change for ordered lists.

This will still be broken for nested lists, but it didn't seem worth it to put a lot of effort into this (or other revamps, like making bold/italics/code work properly) because it seems like the current text handling in Ice Cubes is suboptimal and eventually slated for improvement (according to Dimillian#1459 (comment)).
So this is more designed to make lists "less broken" in some cases, rather than be a comprehensive fix for all lists in all cases.
Dimillian pushed a commit that referenced this issue Nov 27, 2023
While SwiftUI's `Text` view won't display these in an `AttributedString` even if they get parsed from Markdown (which would also require the use of the `.full` option instead of the `.inlineOnlyPresrevingWhitespace` option), we can improve the appearance somewhat.
Currently, list elements are clumped together with no spaces between them, and there's no indication whatsoever that the author indicated these to be a list.
Change to insert Markdown list syntax with linebreaks and dashes, so users can at least understand there's a list there.
Similar change for ordered lists.

This will still be broken for nested lists, but it didn't seem worth it to put a lot of effort into this (or other revamps, like making bold/italics/code work properly) because it seems like the current text handling in Ice Cubes is suboptimal and eventually slated for improvement (according to #1459 (comment)).
So this is more designed to make lists "less broken" in some cases, rather than be a comprehensive fix for all lists in all cases.
ifacodes pushed a commit to ifacodes/IceCubesApp that referenced this issue Dec 20, 2023
…llian#1690)

While SwiftUI's `Text` view won't display these in an `AttributedString` even if they get parsed from Markdown (which would also require the use of the `.full` option instead of the `.inlineOnlyPresrevingWhitespace` option), we can improve the appearance somewhat.
Currently, list elements are clumped together with no spaces between them, and there's no indication whatsoever that the author indicated these to be a list.
Change to insert Markdown list syntax with linebreaks and dashes, so users can at least understand there's a list there.
Similar change for ordered lists.

This will still be broken for nested lists, but it didn't seem worth it to put a lot of effort into this (or other revamps, like making bold/italics/code work properly) because it seems like the current text handling in Ice Cubes is suboptimal and eventually slated for improvement (according to Dimillian#1459 (comment)).
So this is more designed to make lists "less broken" in some cases, rather than be a comprehensive fix for all lists in all cases.
ifacodes pushed a commit to ifacodes/IceCubesApp that referenced this issue Dec 21, 2023
…llian#1690)

While SwiftUI's `Text` view won't display these in an `AttributedString` even if they get parsed from Markdown (which would also require the use of the `.full` option instead of the `.inlineOnlyPresrevingWhitespace` option), we can improve the appearance somewhat.
Currently, list elements are clumped together with no spaces between them, and there's no indication whatsoever that the author indicated these to be a list.
Change to insert Markdown list syntax with linebreaks and dashes, so users can at least understand there's a list there.
Similar change for ordered lists.

This will still be broken for nested lists, but it didn't seem worth it to put a lot of effort into this (or other revamps, like making bold/italics/code work properly) because it seems like the current text handling in Ice Cubes is suboptimal and eventually slated for improvement (according to Dimillian#1459 (comment)).
So this is more designed to make lists "less broken" in some cases, rather than be a comprehensive fix for all lists in all cases.
@imdatceleste imdatceleste closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants