pxt
pxt copied to clipboard
Block "Math.abs" can't load in "Guitar"
Describe the bug Block "Math.abs" can't load in "Guitar"
Steps to reproduce the behavior 1.Navigate to https://makecode.microbit.org/projects/guitar/accelerometer 2.Click "Math.abs"
Expect behavior It can load
Actual behavior
Block "Math.abs" can't load in "Guitar"
Additional context 1.OS: Windows(rs6) 2.makecode.microbit.org version: 3.1.79 3.Microsoft MakeCode version: 6.13.25
The help path is formed incorrectly for functions in pxt-helpers.ts
. The "/reference/"
path prefix isn't prepended to the function's help=
subpath as needed. The reference doc path is ./reference/math/abs.md
so the render code needs to add the ./reference/
piece. This is a pxt bug.
//% help=math/abs
export function abs(x: number): number {
return x < 0 ? -x : x;
}