'From Squeak3.2alpha of 8 October 2001 [latest update: #4418] on 9 October 2001 at 10:57:26 pm'! "Change Set: ComSwiki inline links Date: 9 October 2001 Author: "! Object subclass: #SwikiPageIDAndNameModel instanceVariableNames: 'remaining request text alias pageEntry refId book page result ' classVariableNames: '' poolDictionaries: '' category: 'Swiki-Formatting'! Object subclass: #SwikiRequest instanceVariableNames: 'book page address security settings inlinePageRequests ' classVariableNames: '' poolDictionaries: '' category: 'Swiki-Structure'! !IdFormatter class methodsFor: 'instance creation' stamp: 'dsp 10/9/2001 21:58'! heading: formatter | instance | instance _ self new. instance idBlock: [:text | (text beginsWith: '!!!!') ifTrue: [(text beginsWith: '!!!!!!') ifTrue: ['!!!!!!'] ifFalse: ['!!!!']] ifFalse: ['!!']]. instance startBlock: [:id | '']. instance endBlock: [:id | '', String cr]. instance transitionBlock: [:idOld :idNew | '', String cr, '']. instance formatter: [:text :request :response :shelf :book :page | (book editTagForText: text page: page), (formatter format: text request: request response: response shelf: shelf book: book page: page)]. ^instance! ! !IdFormatter class methodsFor: 'instance creation' stamp: 'dsp 10/9/2001 21:57'! list: formatter | instance match return | instance _ self new. instance idBlock: [:text | return _ 1. [(text size >= return) and: [((text at: return) = $-) or: [(text at: return) = $#]]] whileTrue: [return _ return + 1]. text copyFrom: 1 to: (return-1)]. instance startBlock: [:id | return _ ''. id do: [:char | (char = $-) ifTrue: [return _ return, '', String cr, return] ifFalse: [return _ '', String cr, return]]. return]. instance transitionBlock: [:idOld :idNew | return _ ''. match _ 1. [((idOld size >= match) and: [idNew size >= match]) and: [(idOld at: match) = (idNew at: match)]] whileTrue: [match _ match + 1]. (idOld size > (match - 1)) ifTrue: [(idOld copyFrom: match to: idOld size) do: [:char | (char = $-) ifTrue: [return _ '', String cr, return] ifFalse: [return _ '', String cr, return]]]. (idNew size > (match - 1)) ifTrue: [(idNew copyFrom: match to: idNew size) do: [:char | (char = $-) ifTrue: [return _ return, '