• Resolved wkoudemans

    (@wkoudemans)


    Hello,

    I have a question about the formatting of a Long text field e.g. [apr field=”Notes”]. In my airtable this fields data is formatted with line breaks.

    How do I configure the [apr field=”Notes”] so that it would not be displayed as a long string of text, but formatted with line breaks?

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • I have the same question.

    I notice if you use <br><br> in the Notes text it exports into WordPress with a line break but this is not an elegant solution.

    The simplest solution is to apply this CSS on the element containing your text:

    white-space: pre-wrap;

    Didn’t try, but using nl2br($text) with PHP might do the trick too.

    Plugin Author Chester McLaughlin

    (@chetmac)

    Airpress comes with Parsedown support, so in addition to nl2br and pure CSS solutions, you could try adding the following filter to your theme’s functions.php file:

    
    function my_parsedown_function($output="",$method="text"){
    	global $parsedown;
    
    	if ( method_exists($parsedown, $method) || is_callable(array($parsedown, $method)) ){
    		return call_user_func(array($parsedown, $method),$output);
    	}
    
    	return $output;
    
    }
    add_filter("airpress_shortcode_filter_parsedown","my_parsedown_function",10,2);

    And then use the Airpress Shortcode like this:

    [apr field="Description" format="parsedown|text"]

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Line break in Long Text string’ is closed to new replies.