Refactoring pad a path pad reference in hedgedoc.

This commit is contained in:
ruidajo 2025-03-13 21:26:41 -05:00
parent 3fffd37e8f
commit 7364030158

View File

@ -125,6 +125,8 @@ HedgeDoc >> importContents [
{ #category : #accessing }
HedgeDoc >> pad [
"I represent the url path of the pad in the server"
^ pad
]
@ -181,15 +183,16 @@ HedgeDoc >> url: anObject [
tempUrl := anObject asZnUrl.
html := XMLHTMLParser parse: tempUrl retrieveContents.
(html xpath: '//head/meta[@name="application-name"][@content = "HedgeDoc - Ideas grow better together"]') isEmpty
ifTrue: [ self inform: 'Not a hedgedoc url'.
ifTrue: [ self inform: 'Not a hedgedoc url or hedgedoc pad path.'.
url := nil ].
server := tempUrl host.
pad := tempUrl segments ifNil:[ nil ] ifNotNil: [ tempUrl segments first ].
url := anObject
]
{ #category : #visiting }
HedgeDoc >> visit [
WebBrowser openOn: self server, '/', self pad.
WebBrowser openOn: 'https://', self server, '/', self pad.
]
{ #category : #transformation }