[TW5] Code Block And Hard Linebreaks

101 views
Skip to first unread message

Mark Heptinstall

unread,
Oct 20, 2016, 3:29:17 PM10/20/16
to TiddlyWiki
Is it possible to have hard linebreaks combined with a code block? I am placing an SQL script within a code block but I am finding the indentation to be off.
Using hard linebreaks within a code block the indentation is correct but the """ is displayed at the top and bottom of the code block.

Jeremy Ruston

unread,
Oct 20, 2016, 4:51:14 PM10/20/16
to tiddl...@googlegroups.com
Hi Mark

Is it possible to have hard linebreaks combined with a code block? I am placing an SQL script within a code block but I am finding the indentation to be off.
Using hard linebreaks within a code block the indentation is correct but the """ is displayed at the top and bottom of the code block.

Code blocks support hard line breaks by default; the following should be set in monospace with hard line breaks:

```
'Twas brillig, and the slithy toves
  Did gyre and gimble in the wabe:
All mimsy were the borogoves,
  And the mome raths outgrabe.
```

If you’re seeing something different there may be a problem. What operating system and browser are you using?

Best wishes

Jeremy


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/c0f0ccc8-a25d-4974-9230-c315dabdabaf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark Heptinstall

unread,
Oct 22, 2016, 6:49:52 AM10/22/16
to TiddlyWiki
Windows 10 and tried in latest Chrome and Firefox

If I do the following the """ are visible in the code block and the ColumnB text is not inline with ColumnA, it looks there are two tabs.

```sql
"""
SELECT
ColumnA
, ColumnB

FROM
TableA
"""
```

If I do the following then it looks like hard linebreaks are working, ColumnB text is inline with ColumnA text but it does not render as a code block.
`sql is visible at the top and """ is visible at the bottom

"""
```sql
SELECT
ColumnA
, ColumnB

FROM
TableA
```
"""

If I remove the """ then ColumnB text is not inline with ColumnA, it looks there are two tabs.

Mark Heptinstall

unread,
Oct 22, 2016, 6:52:54 AM10/22/16
to TiddlyWiki
Actually it looks like it is an issue with the Highlight.js plugin rather than Tiddlywiki, removing the plugin the code block renders with hard linebreaks without having to specify them and the text is inline.
Reply all
Reply to author
Forward
0 new messages