Skip to content
This repository has been archived by the owner on May 19, 2020. It is now read-only.

I can't use multibyte char to attribute #17

Open
ysakkk opened this issue Nov 19, 2014 · 0 comments
Open

I can't use multibyte char to attribute #17

ysakkk opened this issue Nov 19, 2014 · 0 comments

Comments

@ysakkk
Copy link

ysakkk commented Nov 19, 2014

input:submit.btn.primary(value="てすと")
will be
<input class="btn primary" value="てすと")

so i modified Lexer/Lexer.php like following.
it's seems ok, what do you think?

diff --git a/src/Everzet/Jade/Lexer/Lexer.php b/src/Everzet/Jade/Lexer/Lexer.php
index 16c55ab..6be2d1a 100644
--- a/src/Everzet/Jade/Lexer/Lexer.php
+++ b/src/Everzet/Jade/Lexer/Lexer.php
@@ -426,6 +426,23 @@ class Lexer implements LexerInterface
$dbrac = false;

     for ($i = 0, $length = mb_strlen($string); $i < $length; ++$i) {
  •                 $c = mb_substr($string,$i,1);
    
  •        if ('"' === $c) {
    
  •            $dbrac = !$dbrac;
    
  •        } elseif ('\'' === $c) {
    
  •            $sbrac = !$sbrac;
    
  •        }
    
  •        if (!$sbrac && !$dbrac && $begin === $c) {
    
  •            ++$nbegin;
    
  •        } elseif (!$sbrac && !$dbrac && $end === $c) {
    
  •            if (++$nend === $nbegin) {
    
  •                $position = $i;
    
  •                break;
    
  •            }
    
  •        }
    
  •     /*
         if ('"' === $string[$i]) {
             $dbrac = !$dbrac;
         } elseif ('\'' === $string[$i]) {
    
    @@ -440,6 +457,7 @@ class Lexer implements LexerInterface
    break;
    }
    }
  •             */
     }
    
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant