KT Walrus Posted September 12, 2009 Posted September 12, 2009 I implemented a quick bbcode for showing pretty fractions, using this php code: { return preg_replace( "/\s*(\d+)\s*\/\s*(\d+)\s*/i", "<span style='font-size:80%'><sup>\\1</sup>& #8260;<sub>\\2</sub></span>", $content ); }For [fraction]3/11[/fraction] it shows as: 3⁄11 (only the fraction height is reduced by 80% so that it looks normal) This works, but I haven't been able to figure out how to get the RTE to show the formatted fraction instead of the BBCode. What I really want is to implement a drop down menu that allows the user to just pick a formatted fraction from the drop down. Maybe all fraction up to 16th such as:1⁄21⁄3 2⁄31⁄4 2⁄4 3⁄41⁄5 2⁄5 3⁄5 4⁄5 So, I've gotten half of what I want, but it occurred to me that IPS could implement this much better. I'd like to see a new dropdown in the editor to allow you to insert a fraction (from the list) and have this fraction appear formatted in the RTE editor. private function _buildOutput( $content )
bfarber Posted September 14, 2009 Posted September 14, 2009 The RTE can't format custom bbcode. I don't think you understand the complexity in what you are asking. :P Unfortunately, I don't see this as a realistic possibility.
Recommended Posts
Archived
This topic is now archived and is closed to further replies.