@@ -86,6 +86,11 @@ def test_github_issue_30():
8686 expect = '\t <p><a href="http://lala.com" title="Tëxtíle">Tëxtíle</a></p>'
8787 assert result == expect
8888
89+ text = '!http://lala.com/lol.gif(♡ imáges)!'
90+ result = textile .textile (text )
91+ expect = '\t <p><img alt="♡ imáges" src="http://lala.com/lol.gif" title="♡ imáges" /></p>'
92+ assert result == expect
93+
8994def test_github_issue_36 ():
9095 text = '"Chögyam Trungpa":https://www.google.com/search?q=Chögyam+Trungpa'
9196 result = textile .textile (text )
@@ -199,3 +204,61 @@ def test_github_issue_52():
199204 '</td>\n \t \t \t <td style="text-align:center;">Second Header </td>'
200205 '\n \t \t </tr>\n \t </table>' )
201206 assert result == expect
207+
208+ def test_github_issue_55 ():
209+ """Incorrect handling of quote entities in extended pre block"""
210+ test = ('pre.. this is the first line\n \n but "quotes" in an extended pre '
211+ 'block need to be handled properly.' )
212+ result = textile .textile (test )
213+ expect = ('<pre>this is the first line\n \n but "quotes" in an '
214+ 'extended pre block need to be handled properly.</pre>' )
215+ assert result == expect
216+
217+ # supplied input
218+ test = ('pre.. import org.slf4j.Logger;\n import org.slf4j.LoggerFactory;'
219+ '\n import ru.onyma.job.Context;\n import ru.onyma.job.'
220+ 'RescheduleTask;\n \n import java.util.concurrent.'
221+ 'ScheduledExecutorService;\n import java.util.concurrent.TimeUnit;'
222+ '\n \n /**\n * @author ustits\n */\n public abstract class '
223+ 'MainService<T> extends RescheduleTask implements Context<T> {\n \n '
224+ 'private static final Logger log = LoggerFactory.getLogger('
225+ 'MainService.class);\n private final ScheduledExecutorService '
226+ 'scheduler;\n \n private boolean isFirstRun = true;\n private T '
227+ 'configs;\n \n public MainService(final ScheduledExecutorService '
228+ 'scheduler) {\n super(scheduler);\n this.scheduler = scheduler;\n }\n '
229+ '\n @Override\n public void setConfig(final T configs) {\n this.'
230+ 'configs = configs;\n if (isFirstRun) {\n scheduler.schedule(this, '
231+ '0, TimeUnit.SECONDS);\n isFirstRun = false;\n }\n }\n \n @Override\n '
232+ 'public void stop() {\n super.stop();\n scheduler.shutdown();\n try {'
233+ '\n scheduler.awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);\n } '
234+ 'catch (InterruptedException ie) {\n log.warn("Unable to wait for '
235+ 'syncs termination", ie);\n Thread.currentThread().interrupt();\n }'
236+ '\n }\n \n protected final T getConfigs() {\n return configs;\n }\n }' )
237+ result = textile .textile (test )
238+ expect = ('<pre>import org.slf4j.Logger;\n import org.slf4j.LoggerFactory;'
239+ '\n import ru.onyma.job.Context;\n import ru.onyma.job.'
240+ 'RescheduleTask;\n \n import java.util.concurrent.'
241+ 'ScheduledExecutorService;\n import java.util.concurrent.'
242+ 'TimeUnit;\n \n /**\n * @author ustits\n */\n public abstract class '
243+ 'MainService<T> extends RescheduleTask implements '
244+ 'Context<T> {\n \n private static final Logger log = '
245+ 'LoggerFactory.getLogger(MainService.class);\n private final '
246+ 'ScheduledExecutorService scheduler;\n \n private boolean '
247+ 'isFirstRun = true;\n private T configs;\n \n public MainService('
248+ 'final ScheduledExecutorService scheduler) {\n super(scheduler);'
249+ '\n this.scheduler = scheduler;\n }\n \n @Override\n public void '
250+ 'setConfig(final T configs) {\n this.configs = configs;\n if ('
251+ 'isFirstRun) {\n scheduler.schedule(this, 0, TimeUnit.SECONDS);'
252+ '\n isFirstRun = false;\n }\n }\n \n @Override\n public void stop() {'
253+ '\n super.stop();\n scheduler.shutdown();\n try {\n scheduler.'
254+ 'awaitTermination(Long.MAX_VALUE, TimeUnit.DAYS);\n } catch '
255+ '(InterruptedException ie) {\n log.warn("Unable to wait '
256+ 'for syncs termination", ie);\n Thread.currentThread().'
257+ 'interrupt();\n }\n }\n \n protected final T getConfigs() {\n '
258+ 'return configs;\n }\n }</pre>' )
259+ assert result == expect
260+
261+ def test_issue_56 ():
262+ result = textile .textile ("- :=\n -" )
263+ expect = '<dl>\n </dl>'
264+ assert result == expect
0 commit comments