Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dj-ref with multiple childrens #11

Open
AbcSxyZ opened this issue Aug 8, 2020 · 0 comments
Open

dj-ref with multiple childrens #11

AbcSxyZ opened this issue Aug 8, 2020 · 0 comments

Comments

@AbcSxyZ
Copy link

AbcSxyZ commented Aug 8, 2020

Problem is show in your example.html file:

<div dj-block="title" >
    <div dj-ref="section.title"> 
        <h1>{{ section.title }} </h1>
    </div>
</div>

is converted to :

  {% block title %}
  <div>
   <div>
    <h1>
     {{ section.title }}
    </h1>
   </div>
  </div>
  {% endblock %}

Actually, dj-ref is not used to create the {{selection.title}}, and use the string already avaible in the example (why using django tag in the example ?).

Actually, bs4 tag is setting string attribute to None when having multiple childs : https://www.crummy.com/software/BeautifulSoup/bs4/doc/#string

You're skipping change with condition:

if ref.string:
    ref.string.replace_with('{{ ' + refattr + ' }}')      
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant