mirror of
https://github.com/ets-cfuhrman-pfe/EvalueTonSavoir.git
synced 2025-08-11 21:23:54 -04:00
new test for resized images
This commit is contained in:
parent
917d7d03c7
commit
55b6c41148
4 changed files with 10 additions and 27 deletions
|
|
@ -100,4 +100,12 @@ describe('TextType', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add more tests for other formats if needed
|
// Add more tests for other formats if needed
|
||||||
|
it('should format a resized image correctly', () => {
|
||||||
|
const input: TextFormat = {
|
||||||
|
text: '',
|
||||||
|
format: 'markdown'
|
||||||
|
};
|
||||||
|
const expectedOutput = '<img width="50p" alt="" src="https://www.etsmtl.ca/assets/img/ets.svg">\n';
|
||||||
|
expect(FormattedTextTemplate(input)).toBe(expectedOutput);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -55,35 +55,9 @@ export default function MultipleChoiceAnswersTemplate({ choices }: MultipleChoic
|
||||||
}
|
}
|
||||||
|
|
||||||
function AnswerWeight({ weight }: AnswerWeightOptions): string {
|
function AnswerWeight({ weight }: AnswerWeightOptions): string {
|
||||||
// const Container = `
|
|
||||||
// box-shadow: 0px 1px 1px ${theme(state.theme, 'gray400', 'black900')};
|
|
||||||
// border-radius: 3px;
|
|
||||||
// padding-left: 0.2rem;
|
|
||||||
// padding-right: 0.2rem;
|
|
||||||
// padding-top: 0.05rem;
|
|
||||||
// padding-bottom: 0.05rem;
|
|
||||||
// `;
|
|
||||||
|
|
||||||
// const CorrectWeight = `
|
|
||||||
// color: ${theme(state.theme, 'green700', 'green100')};
|
|
||||||
// background-color: ${theme(state.theme, 'green100', 'greenGray700')};
|
|
||||||
// `;
|
|
||||||
// const IncorrectWeight = `
|
|
||||||
// color: ${theme(state.theme, 'beige600', 'beige100')};
|
|
||||||
// background-color: ${theme(state.theme, 'beige300', 'beigeGray800')};
|
|
||||||
// `;
|
|
||||||
|
|
||||||
return weight ? `<span class="answer-weight-container ${weight > 0 ? 'answer-positive-weight' : 'answer-zero-or-less-weight'}">${weight}%</span>` : ``;
|
return weight ? `<span class="answer-weight-container ${weight > 0 ? 'answer-positive-weight' : 'answer-zero-or-less-weight'}">${weight}%</span>` : ``;
|
||||||
// ? `<span style="${Container} ${
|
|
||||||
// correct ? `${CorrectWeight}` : `${IncorrectWeight}`
|
|
||||||
// }">${weight}%</span>`
|
|
||||||
// : ``;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function AnswerFeedback({ formattedFeedback }: AnswerFeedbackOptions): string {
|
function AnswerFeedback({ formattedFeedback }: AnswerFeedbackOptions): string {
|
||||||
// const Container = `
|
|
||||||
// color: ${theme(state.theme, 'teal700', 'gray700')};
|
|
||||||
// `;
|
|
||||||
|
|
||||||
return formattedFeedback ? `<span class="feedback-container">${FormattedTextTemplate(formattedFeedback)}</span>` : ``;
|
return formattedFeedback ? `<span class="feedback-container">${FormattedTextTemplate(formattedFeedback)}</span>` : ``;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,3 @@
|
||||||
// import { marked } from 'marked';
|
|
||||||
import marked from 'src/markedConfig';
|
import marked from 'src/markedConfig';
|
||||||
|
|
||||||
import katex from 'katex';
|
import katex from 'katex';
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import { marked, Renderer } from 'marked';
|
import { marked, Renderer } from 'marked';
|
||||||
|
|
||||||
|
// Customized renderer to support image width and height
|
||||||
|
// see https://github.com/markedjs/marked/issues/339#issuecomment-1146363560
|
||||||
const renderer = new Renderer();
|
const renderer = new Renderer();
|
||||||
|
|
||||||
renderer.image = ({href, title, text}) => {
|
renderer.image = ({href, title, text}) => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue