Этот коммит содержится в:
=Corey Hulen
2015-10-22 09:19:18 -07:00
родитель c4c04e5f02 649f42e3fc
Коммит 54894e90ac
31 изменённых файлов: 578 добавлений и 120 удалений

Просмотреть файл

@@ -133,7 +133,7 @@ export function handleEmoticons(text, tokens) {
const alias = `MM_EMOTICON${index}`;
tokens.set(alias, {
value: `<img align="absmiddle" alt=${match} class="emoji" src=${getImagePathForEmoticon(name)} title=${match} />`,
value: `<img align="absmiddle" alt="${match}" class="emoji" src="${getImagePathForEmoticon(name)}" title="${match}" />`,
originalText: match
});

Просмотреть файл

@@ -11,6 +11,7 @@ export class MattermostMarkdownRenderer extends marked.Renderer {
super(options);
this.heading = this.heading.bind(this);
this.paragraph = this.paragraph.bind(this);
this.text = this.text.bind(this);
this.formattingOptions = formattingOptions;
@@ -53,11 +54,17 @@ export class MattermostMarkdownRenderer extends marked.Renderer {
}
paragraph(text) {
if (this.formattingOptions.singleline) {
return `<p class="markdown__paragraph-inline">${text}</p>`;
let outText = text;
if (!('emoticons' in this.options) || this.options.emoticon) {
outText = TextFormatting.doFormatEmoticons(text);
}
return super.paragraph(text);
if (this.formattingOptions.singleline) {
return `<p class="markdown__paragraph-inline">${outText}</p>`;
}
return super.paragraph(outText);
}
table(header, body) {

Просмотреть файл

@@ -69,6 +69,15 @@ export function doFormatText(text, options) {
return output;
}
export function doFormatEmoticons(text) {
const tokens = new Map();
let output = Emoticons.handleEmoticons(text, tokens);
output = replaceTokens(output, tokens);
return output;
}
export function sanitizeHtml(text) {
let output = text;

Просмотреть файл

@@ -544,6 +544,7 @@ export function applyTheme(theme) {
if (theme.buttonBg) {
changeCss('.btn.btn-primary', 'background:' + theme.buttonBg, 1);
changeCss('.btn.btn-primary:hover, .btn.btn-primary:active, .btn.btn-primary:focus', 'background:' + changeColor(theme.buttonBg, -0.25), 1);
changeCss('.file-playback-controls', 'color:' + changeColor(theme.buttonBg, -0.25), 1);
}
if (theme.buttonColor) {