Label parameter matrix

Both the Hide If and Show If macros for Visibility feature the Label parameter. The following is a complete matrix of behaviors when using the Label parameter.

This may help users who prefer using labels with a dash "-" prefix (e.g. "-review") and how the Label parameter behaves when it encounters such labels.

Labels in macro parameter

Page labels

Show If

Hide If

Match Any

-a, b, c, d


false (not show)

false (not hide)

No matches

-a, b, c, d

b

true (show)

true (hide)

Should match only "b"

-a, b, c, d

-a

false (not show)

false (not show)

Should not match

-a, b, c, d

-a, b

true (show)

true (hide)

Should match only "b"

-a


true (show)

true (hide)

Should match, label "-a" is considered not to exist

a, -b, c, d

a, b, c, d

false (not show)

false (not show)

Should not match since "-b" has opposite in page labels

-a

a

false (not show)

false (not show)

Should not match since "-a" has opposite in page labels

-a

-a

true (show)

true (hide)

Should match "-a"

-a

b

true (show)

true (hide)

should match "-a" is not must exist.

rev-iew

rev-iew

true (show)

true (hide)

should match "rev-iew"

review-

review-

true (show)

true (hide)

should match "review-"

Labels in macro parameter

Page labels

Expected (Show If and Hide If)

Actual

Match Any

a, b, c

a, b, c, d

true

true ✅

Should match a/b/c

a, b

a, b, c, d

true

true ✅

Should match a/b

a

a, b, c, d

true

true ✅

Should match "a"

b, e

a, b, c, d

true

true ✅

Should match "b"

-

-

true

true ✅

Should match "-"

-e

a, b, c, d

true

true ✅

Should match since there is no label "e"

a, -e, -f

a, b, c, d

true

true ✅

Should match "a"

page-

page-

true

true ✅

Should match "page-"

-e, -f

a, b, c, d

true

true ✅

Should match since there are no labels "e", "f"

page-

-page-

false

false ✅

Should not match since "page-" is negated

-

--

false

false ✅

Should not match since "-" is negated

--a

-a

false

false ✅

A page label can start with "-". should not match since "-a" is negated