Making the text editor view readable

This forum is for all Flare issues not related to any of the other categories.
Post Reply
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Making the text editor view readable

Post by oceanclub »

Occasionally the source code of my files is concatenated into one unreadable blocks. Does anyone have any tips for automatically formating the XML source to make it human-readable? (I tried XML tools in Notepad++ with no luck).

P.
paintedturtle
Propeller Head
Posts: 88
Joined: Wed May 25, 2016 3:35 pm

Re: Making the text editor view readable

Post by paintedturtle »

oceanclub wrote:Occasionally the source code of my files is concatenated into one unreadable blocks. Does anyone have any tips for automatically formating the XML source to make it human-readable? (I tried XML tools in Notepad++ with no luck).

P.
Hello! Can you show us an example/screenshot?
Technical Writer using and experimenting with Flare version 12.0.5991.
oceanclub
Sr. Propeller Head
Posts: 277
Joined: Thu Oct 10, 2013 4:45 am
Location: Dublin

Re: Making the text editor view readable

Post by oceanclub »

It turns out that it is Flare itself which is making the XML unreadable. I copied the XML sources to Notepad++ and applied an XML tidyup plugin. The result is neatly formatted; eg:

<tr>
<td>
<p>
Reason
</p>
</td>
<td>
<p>
The reason specified when the action was performed
</p>
</td>
</tr>
</tbody>

If I then paste that into the XML editor of Flare and save, it is reformatted as:

</p></td></tr><tr><td><p>
Reason
</p></td><td><p>
The reason specified when the action was performed
</p></td></tr></tbody></table>

Other parts of the XML source are even worse, with absolutely no indentation or line breaks at all.

How do I stop the Flare XML editor from reformatting?


P.
paintedturtle
Propeller Head
Posts: 88
Joined: Wed May 25, 2016 3:35 pm

Re: Making the text editor view readable

Post by paintedturtle »

oceanclub wrote: How do I stop the Flare XML editor from reformatting?
Flare does do automatic reformatting when you move in and out of the Text Editor to see the source code, but it usually tidies up my sloppy code formatting, not messes it up.

My Text Editor does have different pieces of code on separate lines. I have some code:
</th>
<th class="TableStyle-A-HeadD-Column2-Header1">
<p class="bodyBold">Detail</p>
</th>
</tr>
</thead>

I deleted the line break between </th> and </tr> then went into XML and back into Text editor. It had moved the </tr> down onto its own row. So the issues you're having are really odd to me.

What version of Flare are you using? I haven't seen those issues in 11 or 12.
Technical Writer using and experimenting with Flare version 12.0.5991.
Nita Beck
Senior Propellus Maximus
Posts: 3667
Joined: Thu Feb 02, 2006 9:57 am
Location: Pittsford, NY

Re: Making the text editor view readable

Post by Nita Beck »

I see this run-together code with some regularity, which is hugely annoying, but I have no idea why and I tend to (begrudgingly) put up with it. Sorry that I have no solution, but I wanted you to know that you're not alone.

It does seem that I see it in content imported from other tools.
Nita
Image
RETIRED, but still fond of all the Flare friends I've made. See you around now and then!
Pad
Jr. Propeller Head
Posts: 1
Joined: Thu Aug 10, 2017 12:16 pm

Re: Making the text editor view readable

Post by Pad »

Automatic XML formatting (even done badly) may have made sense 20 years ago. But probably 80% or more of technical writers today are comfortable writing HTML and XML. Further, so many of us are producing content for software, that generating garbage code is a non-zero risk to job security. And it's certainly grounds for ridicule by professional coders.

It's perfectly fine to validate my code against the MadCap dtd, but don't reformat my code into a munged-together mess. Just give me the option to turn off Flare's weird code reformatting.

This is particularly troublesome for paragraphs or tables inserted into list items. Flare typically combines all of that into a single line.

Example
From the XML editor, the code that Flare generates looks like this:

Code: Select all

<li><b>(Optional)</b> Edit the sprint environment provision and run times.<div class="row options-table"><div class="medium-2 columns"><b>Provision sprint...</b></div><div class="medium-10 columns left-border"><p>Enter a time for the sprint environments to be created, relative to the race start time. Valid range: <b>1</b> to <b>48</b> hours before the race, in one hour increments.</p><div class="info">After a race is provisioned: <ul><li>sprints cannot added or deleted.</li><li>Most  of the race settings are locked in a read-only view.</li></ul><p>For more information, see <MadCap:xref href="racerooms-edit-race.html">Edit a race</MadCap:xref>.</p></div></div></div><div class="row options-table"><div class="medium-2 columns"><b>Run sprint...</b></div><div class="medium-10 columns left-border"><p>Enter a time for the sprint environments to be run, relative to the race start time. Valid range: <b>1</b> to <b>48</b> hours before the race, in one hour increments.</p></div></div><div class="info"><p class="subhead">Notes</p><ul><li>The <b>Run...</b> value cannot be greater than the <b>Provision...</b> value.</li><li>If the <b>Provision...</b> and <b>Run...</b> values are the same, the environment is run immediately after it is provisioned.</li><li>If the <b>Provision...</b> and/or <b>Run...</b> time has already elapsed when the race is saved, the environments are immediately provisioned and/or run. (For example, if the environments are set to run 3 hours before the race, but the race starts in 1 hour, the environments are immediately run.)</li></ul></div></li>
when it should look like this this:

Code: Select all

<li><strong>(Optional)</strong> Edit the sprint environment provision and run times.
   <div class="row options-table">
      <div class="medium-2 columns"><strong>Provision sprint...</strong></div>
      <div class="medium-10 columns left-border">
         <p>Enter a time for the sprint environments to be created, relative to the race start time. Valid range: <strong>1</strong> to <strong>220</strong> hours before the race, in one hour increments.</p>
         <div class="info">After a race is provisioned:
            <ul>
               <li>sprints cannot added or deleted.</li>
               <li>Most  of the race settings are locked in a read-only view.</li>
            </ul>
            <p>For more information, see <MadCap:xref href="racerooms-edit-race.html">Edit a race</MadCap:xref>.</p>
         </div>
      </div>
   </div>
   <div class="row options-table">
      <div class="medium-2 columns"><strong>Run sprint...</strong></div>
      <div class="medium-10 columns left-border">
         <p>Enter a time for the sprint environments to be run, relative to the race start time. Valid range: <strong>1</strong> to <strong>48</strong> hours before the race, in one hour increments.</p>
      </div>
   </div>
   <div class="info">
      <p class="subhead">Notes</p>
      <ul>
         <li>The <strong>Run...</strong> value cannot be greater than the <strong>Provision...</strong> value.</li>
         <li>If the <strong>Provision...</strong> and <strong>Run...</strong> values are the same, the environment is run immediately after it is provisioned.</li>
         <li>If the <strong>Provision...</strong> and/or <strong>Run...</strong> time has already elapsed when the race is saved, the environments are immediately provisioned and/or run. (For example, if the environments are set to run 3 hours before the race, but the race starts in 1 hour, the environments are immediately run.)</li>
      </ul>
   </div>
</li>
ChoccieMuffin
Senior Propellus Maximus
Posts: 2630
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Making the text editor view readable

Post by ChoccieMuffin »

Not also a bug that I've discovered: I have <h4> on one line, and then the text of the heading on the next line. In my PDF output there's a space at the beginning of the heading, which miraculously goes away when I go into the Text Editor and remove the linefeed. It's a total PITA, and something I could really do without in the run-up to a release!
Started as a newbie with Flare 6.1, now using Flare 2023.
Report bugs at http://www.madcapsoftware.com/bugs/submit.aspx.
Request features at https://www.madcapsoftware.com/feedback ... quest.aspx
kgdyall
Propeller Head
Posts: 12
Joined: Fri Jun 17, 2016 8:48 am

Re: Making the text editor view readable

Post by kgdyall »

When I've seen things like this it's usually been multiple list items on a single line, or multiple paragraphs in a list item. Adding the line breaks manually in the text editor seems to work: they stay in place when you switch between the XML and text editors. Often the symptom in the XML editor is that the bullet for a list item is centered on the paragraphs rather than at the top.
ariestav
Jr. Propeller Head
Posts: 3
Joined: Thu Aug 27, 2015 6:45 pm

Re: Making the text editor view readable

Post by ariestav »

I cannot understand why MadCap doesn't fix the code formatting issue in Flare's Text Editor. I think Flare's Text Editor has got to be, hands down, the worst implementation of a text editor EVER in a desktop application. Humans use the Text Editor and yet Flare's developers could care less about how the code formats. I'm surprised why we put up with it especially at the price point that MadCap sells Flare for.

Beyond the Text Editor issues, there are so many other UI issues in Flare that I cannot even count. It just feels heavy: for example, try moving a window to another "pane" and you are met with probably four interactions just to make it happen. It's as if there is literally NOBODY on Flare's development team who cares about human-computer interaction.

So so so frustrating!
Post Reply