developer.jelix.org is not used any more and exists only for history. Post new tickets on the Github account.
developer.jelix.org n'est plus utilisée, et existe uniquement pour son historique. Postez les nouveaux tickets sur le compte github.

Opened 11 years ago

Closed 10 years ago

Last modified 9 years ago

#1025 closed bug (fixed)

jTpl: EOL after PHP processing instruction in compiled template gets ripped

Reported by: Julien Owned by: Julien
Priority: normal Milestone: Jelix 1.1.6
Component: jelix:tpl Version: trunk
Severity: major Keywords:
Cc: mr.thiriot@… Blocked By:
Blocking: Documentation needed: no
Hosting Provider: Php version:

Description

see http://jelix.org/forums/read.php?5,5916 for example and explanation.

will write a patch

Attachments (2)

linefeed.patch (2.8 KB) - added by doubleface 11 years ago.
Linefeed callback
virtualtemplate.patch (10.5 KB) - added by doubleface 11 years ago.
The patch for #545 with unit tests

Download all attachments as: .zip

Change History (15)

comment:1 Changed 11 years ago by laurentj

  • Milestone changed from Jelix 1.2 to Jelix 1.1.5

comment:2 Changed 11 years ago by laurentj

  • Blocking 1027 added

(In #1027) test

comment:3 Changed 11 years ago by laurentj

  • Blocking 1027 removed

comment:4 Changed 11 years ago by Julien

  • Status changed from new to assigned

Changed 11 years ago by doubleface

Linefeed callback

comment:5 Changed 11 years ago by doubleface

Here is a proposition of patch with a simple callback which adds linefeeds where needed. I suppose it could cause some problems about performance but I don't see any other solution.

comment:6 Changed 11 years ago by doubleface

  • Cc mr.thiriot@… added

comment:7 Changed 11 years ago by doubleface

  • Cc mr.thiriot@… removed

comment:8 Changed 11 years ago by doubleface

  • Cc mr.thiriot@… added

Some unit tests can be found in my patch for #45

comment:9 Changed 11 years ago by doubleface

Sorry not #45 but #545

comment:10 follow-up: Changed 11 years ago by laurentj

Perhaps you could replace the actual regexp, "/{((.).*?)}/sm" by this one "/{((.).*?)}(.?)/sm", and then, in the _callback function, add an echo "\n" if the last char is a linefeed.

Unit test should be added.

comment:11 in reply to: ↑ 10 Changed 11 years ago by doubleface

Unit test should be added.

There are actually some unit tests in my patch for #545. But this is not "unit" tests any more...but it is a lot more simple to test it with virtual templates.

I will try your solution with unit tests.

Changed 11 years ago by doubleface

The patch for #545 with unit tests

comment:12 Changed 10 years ago by laurentj

  • Resolution set to fixed
  • Status changed from assigned to closed
Note: See TracTickets for help on using tickets.