Page 1 of 1

Columns and markup

Posted: 29 Sep 2017, 07:31
by Haider of Sweden
Hi!

I noticed I cannot combine a column like <div class='medium-6 columns'> with markup code.

Am I wrong, or should I turn to plain html once I want to have a column structure?

Re: Columns and markup

Posted: 29 Sep 2017, 23:36
by mjau-mjau
Haider of Sweden wrote:I noticed I cannot combine a column like <div class='medium-6 columns'> with markup code.

Am I wrong, or should I turn to plain html once I want to have a column structure?
That would be correct, and really this is a limitation of markdown. Markdown is supposed to be used as a simple tool for rich text editing, and doesn't combine with HTML. As soon as you add an "opening" html tag, the content within the tag will not render as markdown.

There is a simple fix for this using markdown=1 attribute, but it is not really practical:
Code
<div class='medium-6 columns' markdown=1>
But yes, once you start a HTML structure, really you need to continue with HTML within the html structure you are adding.

We will likely add an optional HTML wysiwig editor in the near future. However, as long as you are using custom HTML structures (like custom columns), this would still have to be added as pure html source.

Re: Columns and markup

Posted: 30 Sep 2017, 10:59
by Haider of Sweden
Can you please explain why you find it not practical?

Looking forward to the future WYSIWYG. Although, I find the existing preview already powerful :)

Re: Columns and markup

Posted: 30 Sep 2017, 11:50
by mjau-mjau
Haider of Sweden wrote:Can you please explain why you find it not practical?
Perhaps "practical" is not the word, but I don't think using markdown=1 is an elegant solution for two reasons:

1. Markdown is supposed to be a simple and elegant solution for rich text editing without the need to know HTML. If you are already using html and understand the basics, it might be good practice to stick to HTML within a content block already started as HTML. Markdown was originally invented to be used instead of html (for basic rich text editing), and mixing them together looks a bit messy (because you are mixing two syntaxes), and kinda defeats the purpose of markdown.

2. The markdown=1 attribute would have to be applied on every html tag where you intend to use markdown inside:
Code
<div class='medium-6 columns' markdown=1>
## markdown header 
  <div data-alert class="alert-box success" markdown=1>
  **strong markdown text**
  </div>
</div>

Having said the above, which is a coder/
aesthetic perspective, there is no reason you can't use markdown=1 where it suits you. I often use markdown and html on the same page myself, because markdown is faster and cleaner for basic formatting, but HTML is obviously required for advanced or custom html content. Personally, I would probably do something like this:
Code
## My title markdown
** Let's stick to markdown when possible ok! **

* Hey let's create a markdown list
* Unicorn
* Pegasus

<div class="medium-6 columns">
  <h2>Here is some HTML</h2>
  I prefer to stick with html tags within a html block.
  <div data-alert class="alert-box success">
    <strong>You bet!</strong>
  </div>
</div>

Re: Columns and markup

Posted: 30 Sep 2017, 13:25
by Haider of Sweden
Thank you!