cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Register to attend Discovery Summit 2025 Online: Early Users Edition, Sept. 24-25.
  • New JMP features coming to desktops everywhere this September. Sign up to learn more at jmp.com/launch.
Choose Language Hide Translation Bar
SDF1
Super User

JSL: How to correctly display ampersand (&) in Textbox() with Markup?

Hello fellow JSL scripters,

 

  I'm trying to use an ampersand in a Text Box() call while also using the <<Markup command, and I'm coming across some issues. Apparently, the <<Markup send command formats text with specified HTML tags.

 

  As an example, here's some JSL that I thought should work, but doesn't.

 

w = New Window( "Formatted Text",
	Text Box( "This is <b>bold</b> text. This is <b><i>bold italic</i></b> text, & this is <u>underlined</u> text.",
	<<Markup) );

  Instead, I get this as the output and an error in the log:

SDF1_1-1750860547690.png

Warning: unterminated entity "&" encountered. -- Turning off markup flag -- This is <b>bold</b> text. This is <b><i>bold italic</i></b> text & is <u>underlined</u> text.
DisplayBox[EvalContextBox]

 

  I would have thought this would be easy to find a solution to, but JMP Help, Scripting Index, Scripting Guide, and searches don't really talk about this specific issue. I did try the HTML tag &amp, and it doesn't work.

 

Thanks for any help!,

DS

 

1 ACCEPTED SOLUTION

Accepted Solutions
SDF1
Super User

Re: JSL: How to correctly display ampersand (&) in Textbox() with Markup?

I just found it by looking at the source code for my posting and saw that I wasn't using the &amp tag correct, it should be: &amp; with the semicolon at the end. It works now.

 

Hope this helps others,

DS

View solution in original post

1 REPLY 1
SDF1
Super User

Re: JSL: How to correctly display ampersand (&) in Textbox() with Markup?

I just found it by looking at the source code for my posting and saw that I wasn't using the &amp tag correct, it should be: &amp; with the semicolon at the end. It works now.

 

Hope this helps others,

DS

Recommended Articles