Fixes markdown line break rendering. Fixes images in the voting on mobile devices

parent baefa3b7
<p [innerHTML]="sanitizeHTML(questionText)"></p> <p [innerHTML]="sanitizeHTML(questionText)"
\ No newline at end of file class="mb-0 overflow-hidden mathjax-container"></p>
...@@ -86,7 +86,7 @@ const appRoutes: Routes = [ ...@@ -86,7 +86,7 @@ const appRoutes: Routes = [
// function that returns `MarkedOptions` with renderer override // function that returns `MarkedOptions` with renderer override
export function markedOptionsFactory(): MarkedOptions { export function markedOptionsFactory(): MarkedOptions {
const renderer = new MarkedRenderer(); const renderer = new MarkedRenderer();
renderer.paragraph = (text) => `${text}\n`; renderer.paragraph = (text) => `${text}<br/>`;
return { return {
renderer: renderer, renderer: renderer,
......
...@@ -70,7 +70,7 @@ export class CustomMarkdownService { ...@@ -70,7 +70,7 @@ export class CustomMarkdownService {
if (imgMatch) { if (imgMatch) {
imgMatch.forEach(token => { imgMatch.forEach(token => {
const imgNode: HTMLImageElement = this.createElementFromHTML(token) as HTMLImageElement; const imgNode: HTMLImageElement = this.createElementFromHTML(token) as HTMLImageElement;
imgNode.classList.add(...['thumbnail', 'cursor-zoom-in', 'img-fluid']); imgNode.classList.add(...['thumbnail', 'cursor-zoom-in']);
const anchorNode = document.createElement<'a'>('a'); const anchorNode = document.createElement<'a'>('a');
anchorNode.href = imgNode.src; anchorNode.href = imgNode.src;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment