If I have a macro with args (Plus: {args: 2, def: '#1+#2', expand: false}) and I add it to a key of a custom keyboard with placeholders for the args ({latex: '+', insert: '\\Plus{\\placeholder{}}{\\placeholder{}}'}) then if I get the value of the math-field the placeholders are not substituted for the values that the user filled in unless I add expand: true to the macro definition and use mf.getValue('latex-expanded') instead of latex or math-ml. Is this the intended behavior?
Placeholders are not substituted unless macro is defined with expand: true and one uses .getValue('latex-expanded')
Expected Behavior
Placeholders are substituted in at least some of the other scenarios.
Environment
MathLive version
mathlive: 0.77.0
Operating System [macOS, Windows, iOS. Include the version]
Ubuntu 20.04.4 LTS
Browser [Safari, Chrome, IE, Firefox, etc... Try several browsers and note
if there are differences between browsers. Include the version number of the
browsers.]
Firefox 103.0 (64-bit)
Also tested in jsfiddle on Chrome 103.0.5060.134 (Official Build) (64-bit).
Description
If I have a macro with args (
Plus: {args: 2, def: '#1+#2', expand: false}
) and I add it to a key of a custom keyboard with placeholders for the args ({latex: '+', insert: '\\Plus{\\placeholder{}}{\\placeholder{}}'}
) then if I get the value of the math-field the placeholders are not substituted for the values that the user filled in unless I addexpand: true
to the macro definition and usemf.getValue('latex-expanded')
instead oflatex
ormath-ml
. Is this the intended behavior?With![WithoutExpand](https://user-images.githubusercontent.com/46454398/182991949-5c32cf8b-d8c0-4ca9-9fdc-c098e5a48377.png)
expand: false
:With![WithExpand](https://user-images.githubusercontent.com/46454398/182991935-7c3996c4-b8b7-4768-8461-09d86e1bc4d8.png)
expand: true
:JSFiddle: https://jsfiddle.net/1rx3huz6/4/ Relevant line is 129.
Actual Behavior
Placeholders are not substituted unless macro is defined with
expand: true
and one uses.getValue('latex-expanded')
Expected Behavior
Placeholders are substituted in at least some of the other scenarios.
Environment
MathLive version mathlive: 0.77.0
Operating System [macOS, Windows, iOS. Include the version] Ubuntu 20.04.4 LTS
Browser [Safari, Chrome, IE, Firefox, etc... Try several browsers and note if there are differences between browsers. Include the version number of the browsers.] Firefox 103.0 (64-bit)
Also tested in jsfiddle on Chrome 103.0.5060.134 (Official Build) (64-bit).