MenuCoranto Docs
Coranto LinksPmWiki Home |
Addons /
Prisoner's Dilemma - Eliminating automatic <br> tagsOn this page... (hide) OverviewAddon Authors: plushpuffin and Parahead Linebreaks and CorantoIn a multi-line text box, like the one used for the main input area on the Coranto submit news page, each time you press the return key on the keyboard Coranto converts this to either <br> or <br />. You can disable this for any multi-line text box on the settings page. In this case the effect is that any newlines entered disappear and when you go back to edit the item it will all be run together on one line. Most of the time the substitution of the <br> or <br /> for a newline is the desired behavior. If you want to enter html or any other text that you want preserved exactly as entered this behavior is a problem. If you have the convert newlines setting off for a multi-line text field the html for a list that you enter as: <ul> Will look like this: <ul> <li>Item One</li> <li>Item Two</li> <li>Item Three</li> </ul> When you attempt to edit it. If this were a longer list or a complicated html table editing becomes difficult. Prisoner's DilemmaPrisoner's Dilemma is an addon that allows to keep using the multi-line text boxes on your submit pages as you normally would and to enter formatted code without the <br> or <br /> tag being added. It does this by adding two new formatting tags for you to use. They are: <BRESCAPE> and </BRESCAPE> They look like this in action: Text here. Another line of text here. Sample address <BRESCAPE> More lines The list of items between the <BRESCAPE> tags will keep the linebreaks, but Coranto will not add the <br> or <br /> tag at the end of each line preventing errors in your html. Required SettingsFor this to work as described above you need to have the settings for the multi-line text field set as follows: Disable HTML? NO Administration -> Edit News Fields -> Edit (under the desired field) Other ConsiderationsValid HTMLThe default Text field in Coranto will be wrapped in <p></p> tags when your news is built. This will cause your html to be invalid when you include an <ul> or a <table> in you input. So to keep the html valid the example above should look like this: Text here. Another line of text here. Sample address <BRESCAPE> More lines The </p> (end paragraph) and <p> (start paragraph) in the above example will result in valid html. Using <br> tagsBetween the <BRESCAPE> tags you can insert <br> or <br /> tags wherever you need them and they will be preserved when saved and be displayed when the item is edited. Further ReadingAddon Release: Prisoner's Dilemma, build 2 You can leave comments using this form. |