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

Formatting in Grist Cells #1161

Closed
georgegevoian opened this issue Aug 14, 2024 · 2 comments
Closed

Formatting in Grist Cells #1161

georgegevoian opened this issue Aug 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@georgegevoian
Copy link
Contributor

Describe the problem to be solved

Grist cells don't currently support formatted text (e.g. headings, lists, bold, italic). Custom widgets are available that can display the contents of cells with such formatting (Markdown, Notepad), but there isn't native support in Grist to display the contents of cells as formatted text.

Describe the solution you would like

The document below contains a proposal for a new cell format for Text columns that renders markup as formatted text.

https://docs.google.com/document/d/1-NmB880GjtsyILz2QYkHEHclvC8038xt537XpAqA5NY/edit?usp=sharing

Comments and feedback are welcome.

@tayflo
Copy link

tayflo commented Oct 19, 2024

Hello there 👋 I've seen that in-cell Markdown is now supported thanks to 292c894 (so it puts an end to the old issue #168 which stands out when browsing the history).

I've tested it a bit, it's great! Very handy, including for bold and multi-hyperlinks in a single cell – it was a feature I sought for, thanks a lot for the implementation.

However, two thoughts came to me about about the implementation (if you prefer I open a new issue, or two new issues, for those topics, let me now):

Line breaks

I was wondering about sticking to the original Markdown specification regarding line breaks, i.e. requiring two spaces at the end of the line for an actual line break.

It might arise to be confusing or cumbersome especially for some non-technical users, and especially since it's not the same behavior in the TextBox model. Right now, if I have a TextBox column with some "standard" newlines (just \n) and that I convert the colum to Markdown, all my paragraphs will be displayed as a single line; to fix that, I would have to convert all \n to \n (or \n\n which would add an empty line between paragraphs).

The requirement for two whitespaces is not implemented in some Markdown-style text input areas of other softwares, for instance here in GitHub comments, or in HedgeDocs.

I'm not saying it should necessarily be ruled out, but I'm wondering about it.

Trimming whitespaces

Multi/leading/trailing-whitespaces characters are now stripped out:

  1. In code blocks, which removes proper indentation.
  2. In code spans, which is not what I would usually expect – it does not happen if word-wrapping is activated on the column tho.

In constrast, the GitHub implementation of Markdown works the way I would expect for those two cases.

Example 1

The code-block:

my_list = [1, 2, 3, 4, 5]
def print_items(list):
  for item in my_list:
    print(item)
print_items(my_list)

is rendered as:

2024-10-19T21-48

Example 2

The code-span:

a b c

is rendered as:

2024-10-19T21-52

and when word-wrapping is activated on the column, it's rendered as:

2024-10-20T16-54

Cheers :-)

@georgegevoian
Copy link
Contributor Author

Hi @tayflo.

Glad you like the feature.

Please feel free to open separate issues for these.

For changes to the behavior of line breaks, we'll watch the issue for interest from other users.

For the handling of whitespace in spans and code blocks, it strikes me as a bug with the CSS at first glance. We'll tag it as a good first issue, and may get to it ourselves depending on the rest of the team's availability.

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

2 participants