Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 23 additions & 25 deletions css/mathlive.less
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@

.ML__mathit {
font-family: @math_math;
/* The @math_math (KaTeX_Math) font is italic
by default, so the font-style below is only
/* The @math_math (KaTeX_Math) font is italic
by default, so the font-style below is only
useful when a fallback font is used
*/
font-style: italic;
Expand All @@ -84,7 +84,7 @@
font-weight: bold;
}

/* lowercase greek symbols should stick to math font when \mathbf is applied
/* lowercase greek symbols should stick to math font when \mathbf is applied
to match TeX idiosyncratic behavior */
.lcGreek.ML__mathbf {
font-family: @math_math;
Expand Down Expand Up @@ -294,14 +294,17 @@
content: '';
display: block;
margin-top: -0.04em;
border-bottom-style: solid;
border-bottom-width: 0.04em;
min-height: 0.04em;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%). Setting the min-height seems to work around it.
/* There's a bug since Chrome 62 where sub-pixel
border lines don't draw at some zoom
levels (110%, 90%).
Setting the min-height used to work around it, but
that workaround broke in Chrome 84 or so.
Setting the background (and the min-height) seems to
work for now.
*/
box-sizing: content-box; /* Vuetify sets the box-sizing to inherit
background: currentColor;
box-sizing: content-box; /* Vuetify sets the box-sizing to inherit
causes the fraction line to not draw at all sizes (see #26) */
}
}
Expand Down Expand Up @@ -443,8 +446,8 @@
&:after {
border-bottom-style: solid;
border-bottom-width: 0.04em;
min-height: thin; /* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
min-height: thin; /* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%). Setting the min-height seems to work around it.
*/
content: '';
Expand Down Expand Up @@ -542,13 +545,8 @@
content: '';
display: block;
margin-top: -0.04em;
border-bottom-style: solid;
border-bottom-width: 0.04em;
min-height: 0.5px;
/* There's a bug since Chrome 62 where
sub-pixel border lines don't draw at some zoom
levels (110%, 90%). Setting the min-height seems to work around it.
*/
min-height: 0.04em;
background: currentColor;
}

&:after {
Expand Down Expand Up @@ -743,7 +741,7 @@
padding-left: 0.25em;
}

/* When using smartFence, the anticipated closing fence is displayed
/* When using smartFence, the anticipated closing fence is displayed
with this style */
.ML__smart-fence__close {
opacity: 0.5;
Expand Down Expand Up @@ -786,9 +784,9 @@ body[theme='dark'] .ML__keystroke-caption {
--keystroke-border: hsl(var(--hue), 50%, 25%);
}

/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
Use 'data-position="top"' to place the tooltip above the
/* Add an attribute 'data-tooltip' to automatically show a
tooltip over a element on hover.
Use 'data-position="top"' to place the tooltip above the
element rather than below.
Use 'data-delay' to delay the triggering of the tooltip.
*/
Expand Down Expand Up @@ -1959,14 +1957,14 @@ div.ML__popover.is-visible {
padding-top: 0.25em;
}

/* Style for the character that joins the modifiers of a keyboard shortcut
/* Style for the character that joins the modifiers of a keyboard shortcut
(usually a "+" sign)*/
.ML__shortcut-join {
opacity: 0.5;
}

/* Styling for an element which is overlaid
to the left and right of the mathfield while
/* Styling for an element which is overlaid
to the left and right of the mathfield while
scrolling to prevent the capture of hover events */
.ML__scroller {
position: fixed;
Expand Down
2 changes: 1 addition & 1 deletion dist/commands.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 0.52.0 */import type { Keys } from './types-utils';
/* 0.52.1-soc */import type { Keys } from './types-utils';
import type { ParseMode, Style } from './core';
import type { Mathfield, Model } from './mathfield';
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/config.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 0.52.0 */import { ErrorListener, MacroDictionary, ParseMode } from './core';
/* 0.52.1-soc */import { ErrorListener, MacroDictionary, ParseMode } from './core';
import type { Mathfield } from './mathfield';
import type { Selector } from './commands';
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/core.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 0.52.0 *//**
/* 0.52.1-soc *//**
* The mode that indicates how a portion of content is interpreted
*
* @deprecated The 'command'mode will be dropped in a future release
Expand Down
2 changes: 1 addition & 1 deletion dist/mathfield.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 0.52.0 */import { Selector } from './commands';
/* 0.52.1-soc */import { Selector } from './commands';
import { MathfieldConfig } from './config';
import { ParseMode, MacroDictionary, Style } from './core';
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/mathlive.core.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/mathlive.css

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions dist/mathlive.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 0.52.0 *//**
/* 0.52.1-soc *//**
*
* Use MathLive to render and edit mathematical formulas.
*
Expand All @@ -13,8 +13,8 @@
* console.log(MathLive.latexToAST('e^{i\\pi}+1=0'));
* </script>
*
* @packageDocumentation MathLive SDK Reference 0.52.0
* @version 0.52.0
* @packageDocumentation MathLive SDK Reference 0.52.1-soc
* @version 0.52.1-soc
*
*/
import { Mathfield } from './mathfield';
Expand All @@ -23,7 +23,7 @@ import { MacroDictionary, ErrorListener } from './core';
export { Mathfield };
export { MathfieldConfig };
/**
* Current version: `0.52.0`
* Current version: `0.52.1-soc`
*
* The version string of the SDK using the [semver](https://semver.org/) convention:
*
Expand Down
4 changes: 2 additions & 2 deletions dist/mathlive.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions dist/mathlive.mjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/types-utils.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* 0.52.0 *//**
/* 0.52.1-soc *//**
* @internal
*/
declare type Filter<T, Cond, U extends keyof T = keyof T> = {
Expand Down
2 changes: 1 addition & 1 deletion dist/vue-mathlive.mjs
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
/* MathLive "0.52.0" */
/* MathLive "0.52.1-soc" */
var t={name:"mathlive-mathfield",template:'<div class="mathfield" :id="id"><slot></slot></div>',props:{id:{type:String,default:""},value:{type:String,default:""},config:{type:Object,default:()=>({})},onKeystroke:{type:Function,default:function(t,e){return!0}},onMoveOutOf:{type:Function,default:function(t){return!0}},onTabOutOf:{type:Function,default:function(t){return!0}}},install:function(t,e){Object.defineProperty(t.prototype,"$mathlive",{value:e}),t.component("mathlive-mathfield",this)},watch:{value:function(t,e){t!==e&&this.$el.mathfield.$latex(t,{suppressChangeNotifications:!0})},config:{deep:!0,handler:function(t){this.$el.mathfield.$setConfig(t)}}},mounted:function(){this.$nextTick(()=>{this.$mathlive.makeMathField(this.$el,{...this.config,onContentDidChange:t=>{this.$emit("input",this.$el.mathfield.$text())},onFocus:t=>{this.$emit("focus")},onBlur:t=>{this.$emit("blur")},onContentWillChange:t=>{this.$emit("content-will-change")},onSelectionWillChange:t=>{this.$emit("selection-will-change")},onUndoStateWillChange:(t,e)=>{this.$emit("undo-state-will-change",e)},onUndoStateDidChange:(t,e)=>{this.$emit("undo-state-did-change",e)},onVirtualKeyboardToggle:(t,e,i)=>{this.$emit("virtual-keyboard-toggle",e,i)},onReadAloudStatus:(t,e)=>{this.$emit("read-aloud-status",e)},onKeystroke:(t,e,i)=>this.onKeystroke(e,i),onMoveOutOf:(t,e)=>this.onMoveOutOf(e),onTabOutOf:(t,e)=>this.onTabOutOf(e)})})},methods:{perform:function(t){this.$el.mathfield.$perform(t)},hasFocus:function(){return this.$el.mathfield.$hasFocus()},focus:function(){this.$el.mathfield.$focus()},blur:function(){this.$el.mathfield.$blur()},text:function(t){return this.$el.mathfield.$text(t)},selectedText:function(t){return this.$el.mathfield.$selectedText(t)},insert:function(t,e){this.$el.mathfield.$insert(t,e)},keystroke:function(t,e){return this.$el.mathfield.$keystroke(t,e)},typedText:function(t){this.$el.mathfield.$keystroke(t)},selectionIsCollapsed:function(){return this.$el.mathfield.$selectionIsCollapsed()},selectionDepth:function(){return this.$el.mathfield.$selectionDepth()},selectionAtStart:function(){return this.$el.mathfield.$selectionAtStart()},selectionAtEnd:function(){return this.$el.mathfield.$selectionAtEnd()},select:function(){this.$el.mathfield.$select()},clearSelection:function(){this.$el.mathfield.$clearSelection()}}};export default t;
2 changes: 1 addition & 1 deletion npm-shrinkwrap.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mathlive",
"version": "0.52.0",
"version": "0.52.1-soc",
"description": "Render and edit beautifully typeset math",
"license": "MIT",
"funding": {
Expand Down
19 changes: 6 additions & 13 deletions src/core/definitions-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const REVERSE_MATH_SYMBOLS = {
'[': '\\lbrack',
']': '\\rbrack',
':': '\\colon', // Also :

'\u00a0': '~', // Also \space
'\u00ac': '\\neg', // Also \lnot

Expand Down Expand Up @@ -366,18 +366,11 @@ export const COMMAND_MODE_CHARACTERS = /[a-zA-Z0-9!@*()-=+{}[\]\\';:?/.,~<>`|'$%
// and Spanish. We use \p{L} (Unicode property escapes: "Letter")
// but Firefox doesn't support it
// (https://bugzilla.mozilla.org/show_bug.cgi?id=1361876). Booo...
// See also https://stackoverflow.com/questions/26133593/using-regex-to-match-international-unicode-alphanumeric-characters-in-javascript
export const LETTER =
typeof navigator !== 'undefined' &&
/firefox|edge/i.test(navigator.userAgent)
? /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/
: new RegExp('\\p{Letter}', 'u');

export const LETTER_AND_DIGITS =
typeof navigator !== 'undefined' &&
/firefox|edge/i.test(navigator.userAgent)
? /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/
: new RegExp('[0-9\\p{Letter}]', 'u');

// Socrative June 17, 2020: Regex was causing issues in IE, older versions of Safari (e.g. on IOS 11), and Firefox
export const LETTER = /[a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/;

export const LETTER_AND_DIGITS = /[0-9a-zA-ZаАбБвВгГдДеЕёЁжЖзЗиИйЙкКлЛмМнНоОпПрРсСтТуУфФхХцЦчЧшШщЩъЪыЫьЬэЭюЮяĄąĆćĘꣳŃńÓóŚśŹźŻżàâäôéèëêïîçùûüÿæœÀÂÄÔÉÈËÊÏΟÇÙÛÜÆŒäöüßÄÖÜẞàèéìíîòóùúÀÈÉÌÍÎÒÓÙÚáéíñóúüÁÉÍÑÓÚÜ]/;

/**
* @param symbol The LaTeX command for this symbol, for
Expand Down