This commit is contained in:
Offray Vladimir Luna Cárdenas 2021-07-15 18:31:40 -05:00
commit 43a9450122
2 changed files with 33 additions and 6 deletions

View File

@ -11,13 +11,13 @@ Class {
'title',
'text',
'modified',
'mofier',
'created',
'creator',
'tags',
'type',
'list',
'caption'
'caption',
'modifier'
],
#category : #'TiddlyWiki-Model'
}
@ -133,15 +133,15 @@ Tiddler >> modified: anObject [
]
{ #category : #accessing }
Tiddler >> mofier [
Tiddler >> modifier [
^ mofier
^ modifier
]
{ #category : #accessing }
Tiddler >> mofier: anObject [
Tiddler >> modifier: anObject [
mofier := anObject
modifier := anObject
]
{ #category : #accessing }

View File

@ -16,3 +16,30 @@ WikiText >> content [
WikiText >> content: aString [
content := aString
]
{ #category : #conversions }
WikiText >> converMarkdownBold [
self content: (self content copyReplaceAll: '**' with: '''''').
]
{ #category : #conversions }
WikiText >> convertMarkdownBold [
self content: (self content copyReplaceAll: '**' with: '''''').
^ self.
]
{ #category : #conversions }
WikiText >> convertMarkdownLinks [
| markdownLinks markdownLinksRegex |
markdownLinksRegex := '\[([\w|\s]+)\]\((\S+)\)'.
"For the explanation of the Regex details see: http://scottradcliff.com/how-to-parse-urls-in-markdown.html"
markdownLinks := self content regex: markdownLinksRegex matchesCollect: [:link | link ].
markdownLinks ifEmpty: [ ^ self ].
markdownLinks do: [:markdownLink | | linkText closingLinkIndex newContent |
closingLinkIndex := markdownLink indexOf: $].
linkText := markdownLink copyFrom: 2 to: closingLinkIndex.
newContent := self content copyReplaceAll: markdownLink with: '[[', linkText, ']'.
self content: newContent.
].
^ self
]