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

Allow multiple mrkdwn elements in <Context> #26

Closed
yhatt opened this issue Jul 11, 2019 · 1 comment · Fixed by #31
Closed

Allow multiple mrkdwn elements in <Context> #26

yhatt opened this issue Jul 11, 2019 · 1 comment · Fixed by #31

Comments

@yhatt
Copy link
Owner

yhatt commented Jul 11, 2019

<Context> merges continuous text contents into one mrkdwn automatically. However, someone may want to control mrkdwn elements separately for layouting message.

Separated mrkdwn have a look like fields in section block, or flexbox layout in HTML.

[
  {
    "type": "context",
    "elements": [
      {
        "type": "mrkdwn",
        "text": "foo\nbar",
        "verbatim": true
      },
      {
        "type": "mrkdwn",
        "text": "A ->\nB ----->\nC ->\nD -->",
        "verbatim": true
      },
      {
        "type": "mrkdwn",
        "text": "Hello,\nworld!",
        "verbatim": true
      }
    ]
  }
]

Our idea is to allow separated mrkdwn contents by using <div> HTML element. It would allow to use an interesting layout in <Context>.

<Blocks>
  <Context>
    <div>
      First mrkdwn element
    </div>
    <div>
      ┐<br />Second markdown element
    </div>
    <div>
      ┌→<br />┘
    </div>
    <img src="https://placekitten.com/100/100" alt="Kitten" />
  </Context>
</Blocks>

This layout makes sense by treating <Context> block as a flex container.

@yhatt
Copy link
Owner Author

yhatt commented Jul 19, 2019

I've used <span> instead of <div> to avoid the side effect for layout in HTML-like formatting in #31. <div> is block element so must render as like as block, but <span> inline element may ignore.

@yhatt yhatt closed this as completed in #31 Jul 20, 2019
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.

1 participant