@@ -238,17 +238,14 @@ private void RenderLoadFilePlease()
238
238
239
239
private void HideLoadFilePlease ( )
240
240
{
241
- if ( metroTabPageChoose . Controls . Cast < Control > ( ) . Where ( x => x . Name == "blockpanel" ) . Count ( ) > 0 )
242
- {
243
- var con = metroTabPageChoose . Controls . Cast < Control > ( ) . Where ( x => x . Name == "blockpanel" ) . First ( ) ;
244
- var con2 = metroTabPageExport . Controls . Cast < Control > ( ) . Where ( x => x . Name == "blockpanel" ) . First ( ) ;
245
- metroTabPageChoose . Controls . RemoveByKey ( "blockpanel" ) ;
246
- metroTabPageExport . Controls . RemoveByKey ( "blockpanel" ) ;
247
- con . Dispose ( ) ;
248
- con = null ;
249
- con2 . Dispose ( ) ;
250
- con2 = null ;
251
- }
241
+ var tabPages = new Control [ ] { metroTabPageExport , metroTabPageChoose } ;
242
+ foreach ( var tabPage in tabPages )
243
+ {
244
+ while ( tabPage . Controls . Cast < Control > ( ) . Where ( x => x . Name == "blockpanel" ) . Count ( ) > 0 )
245
+ {
246
+ tabPage . Controls . RemoveByKey ( "blockpanel" ) ;
247
+ }
248
+ }
252
249
}
253
250
254
251
private void Form1_Load ( object sender , EventArgs e )
@@ -602,6 +599,18 @@ void bgw_DoWork(object sender, DoWorkEventArgs e)
602
599
{
603
600
var contentBody = item . Descendants ( nsContent + "encoded" ) . First ( ) . Value . Replace ( "\n " , "<br />" ) ;
604
601
602
+ //Clean BB-Code images
603
+ Regex re = new Regex ( @"\[imag.*?src=""(.*?)"".*?\]\[\/image\]" , RegexOptions . Multiline | RegexOptions . Singleline ) ;
604
+ MatchCollection mc = re . Matches ( contentBody ) ;
605
+ foreach ( Match m in mc )
606
+ {
607
+ try
608
+ {
609
+ contentBody = contentBody . Replace ( m . Value , "<img src=\" " + m . Groups [ 1 ] . Value + "\" >" ) ;
610
+ }
611
+ catch { }
612
+ }
613
+
605
614
if ( ! ( bool ) ( ( object [ ] ) e . Argument ) [ 4 ] ) // != AllInOne
606
615
{
607
616
var fNameBase = string . Concat ( ( string ) ( ( object [ ] ) e . Argument ) [ 1 ] , "\\ " , CleanFileName ( item . Descendants ( "title" ) . First ( ) . Value ) ) ;
0 commit comments