207 from .HyperlinkMarkupDialog import HyperlinkMarkupDialog |
207 from .HyperlinkMarkupDialog import HyperlinkMarkupDialog |
208 |
208 |
209 if editor is None: |
209 if editor is None: |
210 return |
210 return |
211 |
211 |
212 dlg = HyperlinkMarkupDialog(False, True) |
212 dlg = HyperlinkMarkupDialog(False, True, parent=editor) |
213 if dlg.exec() == QDialog.DialogCode.Accepted: |
213 if dlg.exec() == QDialog.DialogCode.Accepted: |
214 text, target, title = dlg.getData() |
214 text, target, title = dlg.getData() |
215 |
215 |
216 link = "[{0}]".format(text) |
216 link = "[{0}]".format(text) |
217 if target and title: |
217 if target and title: |
299 from .ImageMarkupDialog import ImageMarkupDialog, ImageMarkupMode |
299 from .ImageMarkupDialog import ImageMarkupDialog, ImageMarkupMode |
300 |
300 |
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, parent=editor) |
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) |