Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    If I comment out line 29, it runs through the whole input, otherwise it exits after the first element
    Sergey Protko
    @fesor
    walker remembers which node it should go next
    this is how nodejs implementation worked last time I’ve checked it
    in this case it remembers first child and you replaced it with new one, and walker just don’t know where to go next…
    Ed Langley
    @fiddlerwoaroof
    So, is that a bug or a feature?
    Sergey Protko
    @fesor
    is this something similar that you get?

    So, is that a bug or a feature?

    this is tottaly not a bug… but don’t want to call it feature. This is more like restriction)

    wait a second… will try something
    There is method resumeAt
    so you can tell walker which element to go next manually
    And i added this method for this particular usecase (modifing child nodes)
    Ed Langley
    @fiddlerwoaroof

    Hmm, it seems to give me an infinite loop if I do this:

    $newNode = new Text("new"); $node->firstChild()->replaceWith($newNode); $walker->resumeAt($newNode);

    hmm, maybe I want resumeAt($newNode, $entering=true)?
    Sergey Protko
    @fesor
    yep
    Ed Langley
    @fiddlerwoaroof
    That still gives me an infinite loop
    Sergey Protko
    @fesor
    hm… and this maybe a bug. Sorry, I can look at this a bit closer only tomorrow.
    Ed Langley
    @fiddlerwoaroof
    Ok, I updated the gist with the resumeAt version.
    Sergey Protko
    @fesor
    Thank you)
    Ed Langley
    @fiddlerwoaroof
    No problem
    Marijn van der Werf
    @marijnvdwerf
    I used to
    I used to solve this by using $walker->resumeAt(), followed by a $walker->next() whose output I ignored
    Tiago Alves
    @tiagoalves
    Hi! I need to access the commonmark docs for the 0.7 release since I need PHP 5.3 compatibility. Can anyone tell me if / how I can see the docs at https://commonmark.thephpleague.com but for version 0.7.2?
    Marijn van der Werf
    @marijnvdwerf
    Tiago Alves
    @tiagoalves
    Will do. Thanks!
    King Rayhan
    @kingRayhan
    markdown table is not working
    Mohit Jawanjal
    @mohitjawanjal
    Is this group active?
    Colin O'Dell
    @colinodell
    @kingRayhan league/commonmark does not support tables (it's not part of the spec). Have you tried using https://github.com/webuni/commonmark-table-extension?