Formatting the indentation of the Text View in Flare 12?

This forum is for all Flare issues not related to any of the other categories.
Post Reply
sanjsrik
Sr. Propeller Head
Posts: 103
Joined: Wed Nov 03, 2010 12:57 pm

Formatting the indentation of the Text View in Flare 12?

Post by sanjsrik »

I'm trying to not look at unaligned blocks of text that seem to randomly cut off in the middle of sentences and the tag is where it's supposed to be, but the text is just messy. Nothing lines up with the matching opening tag, nothing looks correct. It's just very frustrating to find something in the Text View if it's just all unaligned.

Does anyone know how to use a better way to align the Text View in Flare 12?

thanks in advance.
andy_smith
Propeller Head
Posts: 24
Joined: Wed Jun 16, 2021 5:41 am

Re: Formatting the indentation of the Text View in Flare 12?

Post by andy_smith »

Looks like you never got a reply to this. I've just googled this problem and found your post.

I have some files that align and indent the tags so that the closing tag is at the right level and enclosed tags are cascaded within them. I have other files where the code is one long block of text. I can add the breaks manually but as soon as I go to XML view and then back to text view the text is one large block again. It's almost as though there's a switch that can be selected that is specific to the document.
I'm on UK time (UTC+0). I work Tuesday, Wednesday and Thursday so I may not see replies outside of those days.
robdocsmith
Sr. Propeller Head
Posts: 247
Joined: Thu May 24, 2018 3:11 pm
Location: Queensland, Australia

Re: Formatting the indentation of the Text View in Flare 12?

Post by robdocsmith »

There isn't really a way. The Text Editor view will automatically adjust the xml whenever you refresh the page view (open the file or switch between xml/text). When I want to do more serious text work with source files (or really need to understand a complicated page) I use an external text editor with a better "Prettify" option and better tag highlighting. However, any indentation will be lost when the file is opened in Flare. You can always open a file directly in an external editor by right clicking the file in Content Explorer and choosing Open With.

Flare particularly struggles with things like tables or other structures within list elements. It will display the tags inline rather than indented.

Rob
JoeSiii
Jr. Propeller Head
Posts: 1
Joined: Wed Oct 12, 2022 2:26 pm

Re: Formatting the indentation of the Text View in Flare 12?

Post by JoeSiii »

I have discovered a big secret that is complicit in Flare's rather annoying tendency to mash nicely formatted html into a contiguous block of text (sans carriage returns and indentation). This most frequently occurs in list items elements, <li>, that contain nested sublists or paragraphs. Flare's treats <li>s as inline elements (similar to <b> and <i>). Carriage returns and indentation are ignored for elements within inline elements. The following is an example of typical nested list formatting, the kind that you can produce in the XML Editor (without having to go the the Text Editor). The behavior is the same for ordered or unordered lists:

Code: Select all

    <ol>
         <li>First ordered list item:
             <p>First nested paragraph.</p>
            <ul>
                <li>First nested bullet sublist item:
                    <p>Second nested paragraph.</p></li>
                <li>Second nested bullet sublist item.</li>
            </ul></li>
        <li>Second ordered list item.</li)
    </ol>
Notice how every paragraph and unordered list item is contained within the first ordered list's <li> element. I guarantee that Flare will mash this into a contiguous block of text when going back and forth between XML and Text editor modes.
Unfortunately, to prevent this behavior, you have to build or edit nested list items within the Text Editor. Don't be intimidated, it is your friend, whereas the XML Editor can be the cause of much trouble and limitation.

Here is a reformatted version of the above source code, fixed in a way that ensures Flare will leave the carriage returns and indentation intact:

Code: Select all

    <ol>
        <li>First ordered list item:</li>
        <p>First nested paragraph.</p>
        <ul>
            <li>First nested bullet sublist item:</li>
            <p>Second nested paragraph.</p>
            <li>Second nested bullet sublist item.</li>
        </ul>
        <li>Second ordered list item.</li)
    </ol>
Notice how no other elements are contained within any of the <li> elements. Of course, you can enclose inline elements like <b>, <i>, <sup>, etc. without causing trouble.

Another element that is typically treated as the inline type is the <span> element. If, for example, you want to apply a MadCap:condition to a set of paragraphs, list items, etc., wrap them in a <div> instead of a <span>, and apply the condition to the <div>, which will not be treated as inline, and formatting will be retained.

I won't say that element nesting within <li> and <span> elements is the sole cause of Flare's text-mashing annoyance. However, since I started using <div>s instead of <span)s and sequential rather than nested formatting of <li> elements, I have not encountered the problem at all.
ChoccieMuffin
Senior Propellus Maximus
Posts: 2632
Joined: Wed Apr 14, 2010 8:01 am
Location: Surrey, UK

Re: Formatting the indentation of the Text View in Flare 12?

Post by ChoccieMuffin »

Joesii, I'm not convinced you've now got valid HTML - I didn't think a <p> was a valid child for an <ol>, as you now seem to have for "First nested paragraph" and "Second nested paragraph".

To make your original source code appear nested, I only had to add two Returns (before </li> in the two places where there are two closing tags).

Code: Select all

    <ol>
         <li><p>First ordered list item:</p>
             <p>First nested paragraph.</p>
            <ul>
                <li><p>First nested bullet sublist item:</p>
                    <p>Second nested paragraph.</p>
                </li>
                <li>Second nested bullet sublist item.</li>
            </ul>
        </li>
        <li>Second ordered list item.</li)
    </ol>
Last edited by ChoccieMuffin on Wed Oct 19, 2022 1:29 am, edited 1 time in total.
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
NorthEast
Master Propellus Maximus
Posts: 6363
Joined: Mon Mar 05, 2007 8:33 am

Re: Formatting the indentation of the Text View in Flare 12?

Post by NorthEast »

This is quite an old post, so I'm assuming we're not using Flare 12 here.

Anyway, I'm not quite sure how you managed to create that HTML code using the XML Editor.

If you want multiple lines of text inside a list item, the only way you could create that in the XML editor is to create paragraph tags for each line. You insert the paragraph tags using the context menu or pressing Ctrl+;, or in more recent versions of Flare you can set it in Options > XML Editor to automatically insert paragraphs in list items.
Once you've created the paragraph tags inside a list item, then pressing Enter gives you a new paragraph/line inside that list item.
If you just have a list item (li) tag with no paragraphs, then pressing Enter gives you a new list item - but not a paragraph.

So I'm confused how you created this:

Code: Select all

<li>Text line 1
  <p>Text line</p>
</li>
Because creating a list using the XML editor would actually give you this:

Code: Select all

<li>
  <p>Text line1</p>
  <p>Text line</p>
</li>
And that second bit of HTML, created by the XML Editor, is also valid HTML.

So I'm not quite sure why you need to edit lists in text mode, or use invalid HTML like putting the paragraph directly inside a list (ol, ul).
Post Reply