Forums / Suggestions / Headings - H1 H2 H3

Headings - H1 H2 H3

Author Message

Esben Maaløe

Friday 27 June 2003 4:08:52 am

The new XML parser is soo much nicer than the old one.

And it 'understands' regular HTML better too.

Why not build in the ability to deal with <H1-6> tags ?

I've looked at it my self briefly - the 'tagalias' array is a little stroke of genious - but altering the parser so that it can create a tag AND and attribute from a tagalias seems too comprehensive... I don't mind 'fixing' my version of the parser - but I hate doing too much to it so that it looses compatability with the original ez parser.

IF I alter it - and provided that my code isn't clumsy or downright stupid - would there be a chance for it to be included in the 'official' parser ?

Alternatively (and better from the systems point of view) - is eZ contemplating such an alteration of the parser ?

Esben Maaløe

Monday 30 June 2003 5:34:19 am

in file:

kernel/classes/datatypes/ezxmltext/handlers/input/ezsimplifiedxmlinput.php

in function &convertInput

I've replaced the lines:

// Convert headers
$text =& preg_replace( "#<header>#", "<header level='1'>", $text );

With

//remove everything in <head></head>
$text =& preg_replace( "#<head(\s|>)+.*</head(\s|>)#", "", $text );

//remove <HTML> tags
$text =& preg_replace( "#</?html[^>]*>#", "", $text );

//remove body tags
$text =& preg_replace( "#</?body[^>]*>#", "", $text );

// Convert headers
$text =& preg_replace( "#<header>#", "<header level='1'>", $text );
$text =& preg_replace( "#<\s*h([0-9])[^>]*>#", "<header level='$1'>", $text );
$text =& preg_replace( "#</h([0-9])[^>]*>#", "</header>", $text );

Which makes eZPub better at handling a html copy/paste job

Valentin Svelland

Monday 14 July 2003 1:31:20 am

Hi Esben. I looked in the file you referred to, but couldn't find the lines to replace. Which version of eZ did you have installed while doing these changes? I want my eZ 3.1 to accept <h1> tags (and h2 etc) while publishing articles in admin as well...

Esben Maaløe

Monday 14 July 2003 5:22:00 am

I replaced it in one of the last betas ( if not the last) before latest release...

I just looked in the latest release - it is the same...

The function begins at line 595 - but do a textsearch for

// Convert headers

eZ debug

Timing: Jan 18 2025 04:31:27
Script start
Timing: Jan 18 2025 04:31:27
Module start 'content'
Timing: Jan 18 2025 04:31:27
Module end 'content'
Timing: Jan 18 2025 04:31:28
Script end

Main resources:

Total runtime0.6483 sec
Peak memory usage4,096.0000 KB
Database Queries197

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0106 588.7266180.8438
Module start 'content' 0.01060.5159 769.5703526.6875
Module end 'content' 0.52640.1218 1,296.2578334.5625
Script end 0.6483  1,630.8203 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00570.8829210.0003
Check MTime0.00190.2942210.0001
Mysql Total
Database connection0.00070.111210.0007
Mysqli_queries0.572088.22771970.0029
Looping result0.00210.31711950.0000
Template Total0.605993.520.3030
Template load0.00310.484820.0016
Template processing0.602892.976420.3014
Template load and register function0.00020.027510.0002
states
state_id_array0.00100.160110.0010
state_identifier_array0.00110.163020.0005
Override
Cache load0.00250.3931380.0001
Sytem overhead
Fetch class attribute can translate value0.00090.140230.0003
Fetch class attribute name0.00090.139150.0002
XML
Image XML parsing0.00100.150130.0003
class_abstraction
Instantiating content class attribute0.00000.001450.0000
General
dbfile0.00180.2750270.0001
String conversion0.00000.001130.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
8content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
4content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 19
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs