273 if editor is None: |
273 if editor is None: |
274 return |
274 return |
275 |
275 |
276 editor.beginUndoAction() |
276 editor.beginUndoAction() |
277 markup = "> " |
277 markup = "> " |
278 sline, sindex, eline, eindex = editor.getSelection() |
278 sline, _sindex, eline, eindex = editor.getSelection() |
279 for line in range(sline, eline + 1 if eindex > 0 else eline): |
279 for line in range(sline, eline + 1 if eindex > 0 else eline): |
280 editor.insertAt(markup, line, 0) |
280 editor.insertAt(markup, line, 0) |
281 editor.endUndoAction() |
281 editor.endUndoAction() |
282 |
282 |
283 def hasImage(self): |
283 def hasImage(self): |
301 if editor is None: |
301 if editor is None: |
302 return |
302 return |
303 |
303 |
304 dlg = ImageMarkupDialog(ImageMarkupMode.MarkDown) |
304 dlg = ImageMarkupDialog(ImageMarkupMode.MarkDown) |
305 if dlg.exec() == QDialog.DialogCode.Accepted: |
305 if dlg.exec() == QDialog.DialogCode.Accepted: |
306 address, altText, title, originalSize, width, height = dlg.getData() |
306 address, altText, title, _originalSize, _width, _height = dlg.getData() |
307 |
307 |
308 if title: |
308 if title: |
309 markup = ''.format(altText, address, title) |
309 markup = ''.format(altText, address, title) |
310 else: |
310 else: |
311 markup = "".format(altText, address) |
311 markup = "".format(altText, address) |
366 |
366 |
367 markup = " 1. " if numberedList else " * " |
367 markup = " 1. " if numberedList else " * " |
368 lineSeparator = editor.getLineSeparator() |
368 lineSeparator = editor.getLineSeparator() |
369 editor.beginUndoAction() |
369 editor.beginUndoAction() |
370 if editor.hasSelectedText(): |
370 if editor.hasSelectedText(): |
371 startLine, startIndex, endLine, endIndex = editor.getSelection() |
371 startLine, _startIndex, endLine, endIndex = editor.getSelection() |
372 if endIndex == 0: |
372 if endIndex == 0: |
373 endLine -= 1 |
373 endLine -= 1 |
374 for line in range(startLine, endLine + 1): |
374 for line in range(startLine, endLine + 1): |
375 editor.insertAt(markup, line, 0) |
375 editor.insertAt(markup, line, 0) |
376 editor.setCursorPosition(endLine + 1, 0) |
376 editor.setCursorPosition(endLine + 1, 0) |