我正在尝试转换以下html
<div class="bbQuote">
<div class="quoteAuthor">Joe Block</div>
<div class="quoteContent">This is the first message<br>
<div class="bbQuote">
<div class="quoteAuthor">Jane Doe</div>
<div class="quoteContent">This is the second message</div>
</div>
</div>
</div>
到下面的bbCode
[quote=Joe Block]
This is the first message
[quote=Jane Doe]
This is the second message
[/quote]
[/quote]
如何使用 jQuery 做到这一点?
PS:嵌套的 HTML 可以有零个或多个孩子