⬆️ ⬇️

Typography for BuEditor by artlebedev

image



- Is it a "typographer"?

- This is "Typographer"!



So, there is a downloaded application from artlebedev.ru (of course the PHP version).

')

We unpack the file remotetypograf.php from the archive in / public_html / sites / all / modules / bueditor / library.



Create a typo.php file with this content:



<?php

$text = stripslashes ($_REQUEST[ 'text' ]);



if ($_POST[ 'text' ])

{

include "remotetypograf.php" ;



$remoteTypograf = new RemoteTypograf( 'UTF-8' );

$remoteTypograf->htmlEntities();

$remoteTypograf->br ( false );

$remoteTypograf->p ( true );

$remoteTypograf->nobr (3);



print $remoteTypograf->processText ($text);

}

?>




* This source code was highlighted with Source Code Highlighter .




and throw in / public_html / sites / all / modules / bueditor / library



Go to the editor settings and add the button:



js:

$.post( '/sites/all/modules/bueditor/library/typo.php' ,

{ text: editor.active.getContent() }, function(data) { editor.active.setContent(data) });




* This source code was highlighted with Source Code Highlighter .




Seen bug / glitch: if there are tags in the text, paragraphs are killed. So, first type in, then arrange the tags.



Good luck!

Source: https://habr.com/ru/post/83294/



All Articles