Way to make Text box format default to HTML?

General discussions about MagicDraw

Moderator: Moderators

Way to make Text box format default to HTML?

Postby pol128@live.com » Wed Oct 19, 2022 10:47 am

I actually want to find a way to keep the Text editor to default to HTML to preserve carriage returns/line breaks when going from CSM (in this case Requirements Text) to Excel (xlsx) and back. It seems if I make a change in Excel and save, "Read from File" changes the CSM text back to Plain Text, which will then lose all the carriage return/line break formatting next time I "Write to File" in the Excel.

Is there a way to default Text format editing to be HTML?

Why would I want this? Say the requirements text description has breaks shown below:

This is a narrative.
With breaks which I call subtext.
Line 1
Line 2

It then becomes the following in Plain Text during the import/export to Excel:

This is a narrative. With breaks which I call subtext. Line 1 Line 2
pol128@live.com
Forum Newbie
Forum Newbie
 
Posts: 2
Posts Rating:0
Joined: Wed Oct 19, 2022 10:27 am

Re: Way to make Text box format default to HTML?

Postby peterparker281199@gmail.com » Sun Nov 20, 2022 10:01 pm

I also have the same problem as you but no reasonable solution yet five nights at freddy's
peterparker281199@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Mon May 30, 2022 1:42 am

Re: Way to make Text box format default to HTML?

Postby dhillonkeneth@gmail.com » Sat Feb 11, 2023 5:22 am

To make the text box format default to HTML, you can add the following code to the header section of your HTML page:

<textarea name="textarea" cols="50" rows="10" contenteditable="true" spellcheck="false" wrap="soft" accept-charset="UTF-8">
</textarea>
And add this attribute:

style="white-space:pre-wrap;word-wrap:break-word;"

This will ensure that the text box is formatted as HTML by default and allows for line breaks and wrapping of text within the text box.
dhillonkeneth@gmail.com
Forum Newbie
Forum Newbie
 
Posts: 1
Posts Rating:0
Joined: Sat Feb 11, 2023 5:19 am


Return to MagicDraw

Who is online

Users browsing this forum: No registered users and 1 guest