Bug #41327

jsInline removes closing brackets

Added by Simon Schaufelberger about 7 years ago. Updated 9 months ago.

Status:
Accepted
Priority:
Must have
Assignee:
Category:
TypoScript
Target version:
-
Start date:
2012-09-24
Due date:
% Done:

0%

TYPO3 Version:
6.2
PHP Version:
Tags:
Complexity:
nightmare
Is Regression:
No
Sprint Focus:

Description

this code does NOT work;

    jsInline {
        10 = TEXT
        10.value (
            jquery(document).ready(function($) {
                $('.pagination li').hover(
                    function(){$(this).not('.current').find('em').stop().animate({left: "0px"}, 300)},
                    function(){$(this).not('.current').find('em').stop().animate({left: "-270px"}, 300)}
                );
            });
        )
    }

but this one does (notice the last line):
    jsInline {
        10 = TEXT
        10.value (
            jquery(document).ready(function($) {
                $('.pagination li').hover(
                    function(){$(this).not('.current').find('em').stop().animate({left: "0px"}, 300)},
                    function(){$(this).not('.current').find('em').stop().animate({left: "-270px"}, 300)});});
        )
    }

i guess TYPO3 somehow interprets the last closing brackets as the closing bracket for the 10.value which is really strange.

History

#1 Updated by Stefan Galinski about 7 years ago

  • Status changed from New to Accepted

Just reproduced this example with the current master. Also if this can maybe fixed, I don' think that the parser can ever work perfectly for such constructs if there isn't something like a CDATA section in XML for such kind of inline code to indicate the parser to not parse the inner content for syntax elements except the ending marker.

#2 Updated by Mathias Schreiber almost 5 years ago

  • Target version set to 7.2 (Frontend)
  • Complexity set to nightmare
  • Is Regression set to No

#3 Updated by Riccardo De Contardi over 4 years ago

  • Status changed from Accepted to Needs Feedback
  • Assignee set to Simon Schaufelberger

Hi Simon, I am looking at your initial javascript code, and I think there is an error: shouldn't it be:

jquery(document).ready(function($) {
    $('.pagination li').hover(
        function(){$(this).not('.current').find('em').stop().animate({left: "0px"}, 300)},
        function(){$(this).not('.current').find('em').stop().animate({left: "-270px"}, 300)} /*<< here a "}" seems necessary */
    );
}); 

? The second code has the same problem, I think.

#4 Updated by Riccardo De Contardi over 4 years ago

  • Status changed from Needs Feedback to Accepted
  • Assignee changed from Simon Schaufelberger to Benni Mack
  • TYPO3 Version changed from 4.7 to 6.2

The bug is still present in 6.2.12 and seems indipendent from the lack of the "}" I noticed.

#5 Updated by Gerrit Code Review over 4 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/39596

#6 Updated by Benni Mack over 4 years ago

  • Target version changed from 7.2 (Frontend) to 7.4 (Backend)

#7 Updated by Benni Mack over 4 years ago

  • Status changed from Under Review to Accepted
  • Target version changed from 7.4 (Backend) to 7 LTS

#8 Updated by Benni Mack about 4 years ago

  • Target version deleted (7 LTS)

#9 Updated by Simon Schaufelberger 9 months ago

  • Description updated (diff)

Also available in: Atom PDF