Page 1 of 1
Line break in a Snippet
Posted: Thu Aug 24, 2017 9:20 am
by TheBrittleTechWriter
Is it possible to put an HTML line break (<br />) in a snippet? It currently ignores it and so all the lines are put together. It also ignores forced line breaks (shift-Enter). Hard returns are too widely spaced and I don't want to have a special style just to get it to work right.
Re: Line break in a Snippet
Posted: Thu Aug 24, 2017 10:45 am
by devjoe
The behavior you are seeing depends on whether you are inserting the snippet as a snippetblock (by itself in a paragraph of the containing document - preserves paragraph breaks and such formatting) or a snippettext (in a paragraph of the containing document with other text - inserts only the text and inline formatting from the snippet).
Re: Line break in a Snippet
Posted: Wed Aug 30, 2017 11:18 am
by TheBrittleTechWriter
Thanks.
Interesting. The breaks appear in a snippet as part of a list, but the list is preceded and followed by another paragraph each.
If I understand you correctly, in this case I won't be able to get the breaks to work properly?
Re: Line break in a Snippet
Posted: Wed Aug 30, 2017 2:06 pm
by Nita Beck
devjoe is pointing you in the right direction. "It all depends" on whether you've inserted the snippet as "snippetText" or "snippetBlock".
How about if you post the bit of code that shows the list items, paragraphs, and snippet so we can see what's what?
(Off topic: So I see you are in Chicago. There are several Chicago area Flare users who are now congregating in the #illinois channel of the new Slack community dedicated to Flare user groups. If you're interested in joining the community, PM me the email address to which you'd like me to send the Slack invitation.)
Re: Line break in a Snippet
Posted: Tue Oct 24, 2017 1:23 pm
by ryanr
I'm not the original poster of this question, but I'm having the same issue. I feel like I'm close to figuring it out from reading this thread, but I still haven't solved it. Here's the code of the topic in which I've used the snippet:
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="
http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="6" MadCap:lastHeight="1052" MadCap:lastWidth="1389">
<head><title></title>
<link rel="stylesheet" href="../Resources/StyleSheets/rr demo style.css" type="text/css" />
</head>
<body>
<h1>Enabling Skype for Business in Prysm Go</h1>
<MadCap:snippetblock src="../Resources/Snippets/ConfigS4BInPrysmGoSnpt.flsnp" />
</body>
</html>
And here is a bit of code from the snippet. You can see a few <br /> tags here, which are being ignored when I place the snippet in the topic:
<ol>
<li>From the <strong>Deployments</strong> page, use the <strong>Search</strong> field to find the desired deployment, and click <strong>Edit.<br /></strong>The Edit Deployment page is displayed.</li>
<li>Click <strong>Enhancements.</strong></li>
<li>Click <strong>Skype For Business</strong>.<br />The Edit Skype For Business Settings page displays.<br /><img class="largeimages" src="../Images/SoftwareAdminGd/169721262.png" /></li>
I tested out changing MadCap:snippetblock to MadCap:snippettext, and that made the entire topic one long string of unbroken text.
Any more guidance you could give would be greatly appreciated. Thanks!
Re: Line break in a Snippet
Posted: Wed Oct 25, 2017 1:22 am
by Rene Severens
Hi,
In Flare all text formatting is best done using a p-tag, so use a p-tag like this:
<ol>
<li><p>From the <strong>Deployments</strong> page, use the <strong>Search</strong> field to find the desired deployment, and click <strong>Edit.</p>
<p></strong>The Edit Deployment page is displayed.</p></li>
<li><p>Click <strong>Enhancements.</strong></p></li>
<li><p>Click <strong>Skype For Business</strong>.</p><p>The Edit Skype For Business Settings page displays.</p><img class="largeimages" src="../Images/SoftwareAdminGd/169721262.png" /></li>
...
</ol> I hope you finish the <ol> also.
In Flare all text formatting is best done using a p-tag
This even shows the lines neatly formatted in the text editor view.
Greetings,
Rene Severens
Re: Line break in a Snippet
Posted: Wed Oct 25, 2017 4:28 am
by ChoccieMuffin
Quick reply to ryanr: put your snippetblock inside a <p>, it should work after that.
Re: Line break in a Snippet
Posted: Wed Oct 25, 2017 6:32 am
by ryanr
Thanks, everyone! Adding <p> tags instead of <br /> tags to break lines solved the problem. We have liked the spacing and had no problems before with avoiding <p> tags inside <li> tags and other such elements. But we might have to rethink our formatting.
Re: Line break in a Snippet
Posted: Tue Feb 27, 2018 9:34 am
by nielsf
I have a similar problem - but my snippets do not use the <br /> tag. I have this snippet:
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<html xmlns:MadCap="http://www.madcapsoftware.com/Schemas/MadCap.xsd" MadCap:lastBlockDepth="3" MadCap:lastHeight="130" MadCap:lastWidth="1344">
<head>
<link href="../../../Stylesheets/styles.css" rel="stylesheet" type="text/css" />
</head>
<body>
<p><b>MVS (Market Value System)</b> is the <MadCap:variable name="General.ProductName" /> calculation core for performing insurance mathematics at tariff level. </p>
<p>The <b>MVS</b> core functionality offers tariff calculation of expected cash values, payments, etc. <b>MVS</b> offers a flexible modeling of calculation bases as well as the possibility to model transformations of calculation bases. Furthermore, <b>MVS</b> includes a framework for implementation of portfolio calculations, for instance for risk management and solvency assessments, as well as a framework for implementing rules-based creation and modification to assemble the tariffs required for the calculation of for instance policies.</p>
</body>
</html>
I add it like this:
Code: Select all
<div class="intro">
<MadCap:snippetText src="../../../../Resources/Snippets/RN/IntrosUS/MVS.flsnp" />
</div>
But it comes out as just one paragraph, not two. I've tried most everything - removing head, body, html whatever from the snippet, I tried adding the div directly in the snippet, but it always comes as one paragraph.
Now why would that be?

Re: Line break in a Snippet
Posted: Tue Feb 27, 2018 1:10 pm
by pdenchfield
Try replacing
MadCap:snippetText
with
MadCap:snippetBlock

Re: Line break in a Snippet
Posted: Wed Feb 28, 2018 12:57 am
by nielsf
There you go. Thanks!
Funny, I never realized there was a difference. I always just assumed that if you added the snippet inline, it was inline, and if you added it as a separate paragraph, it was a block...
I am now the wiser, and I thank thee!
-Niels