...
` inside the swiper.
# Wait, this is dangerous because of nested divs.
# Instead, since we know there are 5 swipers in the file:
# 1. Gallery
# 2. Chứng chỉ
# 3. Giấy chứng nhận
# 4. Quá trình thực hành (xac-nhan-thuc-hanh)
# 5. Hình ảnh thực hành (thuc-hanh / training-practical)
# A safer approach is to split the content by ``
parts = content.split('
')
if len(parts) >= 6:
new_content = parts[0]
slugs = ['gallery', 'chung-chi', 'giay-chung-nhan', 'xac-nhan-thuc-hanh', 'hinh-anh-thuc-hanh']
for i in range(1, len(parts)):
# Find the closing
of the swiper-wrapper.
# This is the first
that balances the wrapper, or since we know it's a list of ,
# we can just find the end of the last swiper-slide.
part = parts[i]
# We know each wrapper is closed by
.
# But there are nested divs.
# A simple hack: look for the end of the last slide which is followed by .
# Actually, let's just find the first `` that belongs to the wrapper.
# Since the slider items end, the wrapper ends with ``.
# Let's count `