Can I import a text ignoring the source styles?
The StreetLib Write editor provides the ability to manage some custom settings.
We can reach the “Settings " window by collapsing the editor toolbar and clicking on the gear icon.
Custom editor settings can be very useful especially when dealing with copy / paste conversions from pdf.
Let's see them in detail:
1) in copy/paste, only use text and ignore source styles
By selecting this setting, the pasted text is cleaned of any formatting from the original document. In practice, it’s the same as pasting text on Notepad, it removes all styles and formatting.
This action will help us to have a cleaner code and will allow us to avoid surprises at the output level when we associate the related theme.
Attention: This step will require the re-application of all styles that we want to maintain, including line breaks.
In these cases the advice is to paste the text on StreetLib Write, not in preview mode but in code mode. This is the best way to visualize, at a glance, where the line breaks are expected in the original text, and in code mode, we can then add them manually.
2) Use line breaks (<br>) instead of paragraphs (<p>)
This option can be activated when we want only line breaks (wrapped) in the text, without further formatting.
The <br > tag, in fact, is a unique tag that simply indicates that at that exact point the text must go to the end of the line.
The <p> tag, as opposed to <br>, has an open (<p>) and a close (</p>) command and can provide style attributes, both inline and via CSS. The text enclosed between <p> and < / P> can be subject to specific formatting, depending on the settings provided by the CSS of the theme you want to activate.
3) In book generation, excluding HTML tags without any content
If you have converted from PDF, you will certainly have noticed that in some cases, copying the original text, you bring with you a lot of redundant and unnecessary code, including empty HTML tags (opened and immediately after closed) such as:
<div></div>
By selecting this setting, all these HTML tags are automatically deleted from StreetLib Write, generating much cleaner code.
4) Convert tags
If this option is enabled, StreetLib Write will automatically replace all <div> tags with <p> tags.
If this command is triggered along with "use line breaks (<br>) instead of paragraphs (<p>)", the result will be this:
1) First, all the <div> will be converted to <p>
2) then all <p> will be converted to <br>
Finally, of all the initial codes, only the <br> for line breaks will be kept.