Closed OlgaRedozubova closed 3 weeks ago
Does it work with general MMD elements with many inline/block elements or does it only work with a single inline element?
Does it work with general MMD elements with many inline/block elements or does it only work with a single inline element?
This PR is designed to calculate the size of a single line. The line can only contain text and math. For text, latex commands for bold and italic are allowed.
This only works for a block token with the inline type (since the inline Parsing rules apply to this token). Size calculation is performed only for text and math
branch:
dev/olga/add-markdownToHTMLWithSize-v3
Fixes:
markdownToHTMLWithSize
What has been changed:
To solve the issue, we need to be able to find out the dimensions of the received HTML. But Node applications do not have access to the DOM tree to calculate the height and width.
The original mmd content can contain text (normal, bold, italic) and math
Math already has the dimensions specified in the internal mml tree. The width and height are specified in
ex
.Added the ability to calculate the width of the text field in
ex
. For text, we can calculate the width using font metrics. To do this, we need to pass the font parameters in themarkdownToHTMLWithSize
function in the format:For example.
Result:
mmd:
\(\bar{x}\pm\mathrm{s}\) (mean \(\pm\) SD)
result: