Browse Source

text markdown with `monospace`

master
Simon Grim 9 years ago
parent
commit
ad7c95308c
  1. 9
      css/style.css
  2. 7
      js/twister_formatpost.js
  3. 9
      theme_calm/css/style.css
  4. 4
      theme_nin/css/style.css
  5. 2
      theme_nin/sass/_postboard.sass

9
css/style.css

@ -1025,12 +1025,17 @@ ol.toptrends-list {
opacity: .5; opacity: .5;
text-decoration: none; text-decoration: none;
} }
.post-text
{ .post-text {
font-size: 13px; font-size: 13px;
margin: 2px 10px 4px 60px; margin: 2px 10px 4px 60px;
word-wrap: break-word; word-wrap: break-word;
} }
.post-text samp {
background: #f0efcc;
}
.post-context .post-context
{ {
font-size: 11px; font-size: 11px;

7
js/twister_formatpost.js

@ -366,7 +366,7 @@ function htmlFormatMsg(msg, mentions) {
var stopCharsLeft = '<' + whiteSpaces; var stopCharsLeft = '<' + whiteSpaces;
var stopCharsRight = '>' + whiteSpaces; var stopCharsRight = '>' + whiteSpaces;
var stopCharsRightHashtags = stopCharsRight + stopCharsTrailing; var stopCharsRightHashtags = stopCharsRight + stopCharsTrailing;
var stopCharsMarkDown = '~_-+=<>&' + stopCharsTrailing + whiteSpaces; var stopCharsMarkDown = '~_-`+=<>&' + stopCharsTrailing + whiteSpaces;
var j, str, strEncoded; var j, str, strEncoded;
var html = []; var html = [];
@ -485,11 +485,12 @@ function htmlFormatMsg(msg, mentions) {
} }
} }
msg = markdown(markdown(markdown(markdown(msg, msg = markdown(markdown(markdown(markdown(markdown(msg,
'*', 'b'), // bold '*', 'b'), // bold
'~', 'i'), // italic '~', 'i'), // italic
'_', 'u'), // underlined '_', 'u'), // underlined
'-', 's') // striketrough '-', 's'), // striketrough
'`', 'samp') // kind of monospace
.replace(/\(\d{1,2}\/\d{1,2}\)$/, htmlSplitCounter) .replace(/\(\d{1,2}\/\d{1,2}\)$/, htmlSplitCounter)
.replace(/&(?!lt;|gt;)/g, '&amp;') // FIXME in many cases there is no need to escape ampersand in HTML 5 .replace(/&(?!lt;|gt;)/g, '&amp;') // FIXME in many cases there is no need to escape ampersand in HTML 5
.replace(/"/g, '&quot;') .replace(/"/g, '&quot;')

9
theme_calm/css/style.css

@ -1230,12 +1230,17 @@ textarea.splited-post {
text-decoration: none; text-decoration: none;
color: #43464d; color: #43464d;
} }
.post-text
{ .post-text {
font-size: 13px; font-size: 13px;
margin: 2px 10px 4px 60px; margin: 2px 10px 4px 60px;
word-wrap: break-word; word-wrap: break-word;
} }
.post-text samp {
background: #eee;
}
.post-context .post-context
{ {
font-size: 11px; font-size: 11px;

4
theme_nin/css/style.css

@ -878,6 +878,10 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu,
padding: 0; padding: 0;
} }
.post-text samp {
background: #eee;
}
/* line 138, ../sass/_postboard.sass */ /* line 138, ../sass/_postboard.sass */
.post-context { .post-context {
font-size: 11px; font-size: 11px;

2
theme_nin/sass/_postboard.sass

@ -134,6 +134,8 @@
word-wrap: break-word word-wrap: break-word
min-height: 25px min-height: 25px
padding: 0 padding: 0
samp
background: #eee
.post-context .post-context
font-size: 11px font-size: 11px

Loading…
Cancel
Save