FIX: Bold, italic should not expect a space boundary
This commit is contained in:
parent
7a65ee3282
commit
24ddb6cfad
|
@ -7,14 +7,12 @@
|
|||
Discourse.Dialect.inlineBetween({
|
||||
between: '***',
|
||||
wordBoundary: true,
|
||||
spaceBoundary: true,
|
||||
emitter: function(contents) { return ['strong', ['em'].concat(contents)]; }
|
||||
});
|
||||
|
||||
Discourse.Dialect.inlineBetween({
|
||||
between: '___',
|
||||
wordBoundary: true,
|
||||
spaceBoundary: true,
|
||||
emitter: function(contents) { return ['strong', ['em'].concat(contents)]; }
|
||||
});
|
||||
|
||||
|
@ -23,7 +21,6 @@ var replaceMarkdown = function(match, tag) {
|
|||
Discourse.Dialect.inlineBetween({
|
||||
between: match,
|
||||
wordBoundary: true,
|
||||
spaceBoundary: true,
|
||||
emitter: function(contents) { return [tag].concat(contents) }
|
||||
});
|
||||
};
|
||||
|
|
|
@ -254,7 +254,7 @@ Discourse.Dialect = {
|
|||
@param {String} [opts.between] A shortcut for when the `start` and `stop` are the same.
|
||||
@param {Boolean} [opts.rawContents] If true, the contents between the tokens will not be parsed.
|
||||
@param {Boolean} [opts.wordBoundary] If true, the match must be on a word boundary
|
||||
@param {Boolean} [opts.spaceBoundary] If true, the match must be on a sppace boundary
|
||||
@param {Boolean} [opts.spaceBoundary] If true, the match must be on a space boundary
|
||||
**/
|
||||
inlineBetween: function(args) {
|
||||
var start = args.start || args.between,
|
||||
|
|
|
@ -242,6 +242,11 @@ describe PrettyText do
|
|||
|
||||
|
||||
describe "markdown quirks" do
|
||||
it "bolds stuff in parens" do
|
||||
PrettyText.cook("a \"**hello**\"").should match_html "<p>a "<strong>hello</strong>"</p>"
|
||||
PrettyText.cook("(**hello**)").should match_html "<p>(<strong>hello</strong>)</p>"
|
||||
# is it me your looking for?
|
||||
end
|
||||
it "allows for newline after bold" do
|
||||
PrettyText.cook("**hello**\nworld").should match_html "<p><strong>hello</strong><br />world</p>"
|
||||
end
|
||||
|
@ -249,6 +254,10 @@ describe PrettyText do
|
|||
PrettyText.cook("**hello**\n**world**").should match_html "<p><strong>hello</strong><br /><strong>world</strong></p>"
|
||||
end
|
||||
|
||||
pending "allows does not bold chinese intra word" do
|
||||
PrettyText.cook("你**hello**").should match_html "<p>你**hello**</p>"
|
||||
end
|
||||
|
||||
pending "does not break a streak for mentions" do
|
||||
Fabricate(:user, username: 'sam')
|
||||
PrettyText.cook("<small>a @sam c</small>").should match_html "<p><small>a <a class='mention' href='/users/sam'>@sam</a> c</small></p>"
|
||||
|
|
Loading…
Reference in New Issue