wiki-server 0.25.4 → 0.25.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/search.coffee CHANGED
@@ -151,9 +151,9 @@ module.exports = exports = (argv) ->
151
151
  if currentItem.text?
152
152
  switch currentItem.type
153
153
  when 'paragraph', 'markdown', 'html', 'reference', 'image', 'pagefold', 'math', 'mathjax', 'code'
154
- pageText += extractItemText currentItem.text
154
+ pageText += ' ' + extractItemText currentItem.text
155
155
  when 'audio', 'video', 'frame'
156
- pageText += extractItemText(currentItem.text.split(/\r\n?|\n/)
156
+ pageText += ' ' + extractItemText(currentItem.text.split(/\r\n?|\n/)
157
157
  .map((line) ->
158
158
  firstWord = line.split(/\p{White_Space}/u)[0]
159
159
  if firstWord.startsWith('http') or firstWord.toUpperCase() is firstWord or firstWord.startsWith('//')
package/lib/server.coffee CHANGED
@@ -285,7 +285,7 @@ module.exports = exports = (argv) ->
285
285
  # Can also be handled by the client, but it also sets up
286
286
  # the login status, and related footer html, which the client
287
287
  # relies on to know if it is logged in or not.
288
- app.get ///^((/[a-zA-Z0-9:.-]+/[a-z0-9-]+(_rev\d+)?)+)/?$///, (req, res, next) ->
288
+ app.get ///^((/[a-zA-Z0-9:.-]+/[a-z0-9-]+(_rev\d+)?)+)/?$///, cors, (req, res, next) ->
289
289
  urlPages = (i for i in req.params[0].split('/') by 2)[1..]
290
290
  urlLocs = (j for j in req.params[0].split('/')[1..] by 2)
291
291
  if ['plugin', 'auth'].indexOf(urlLocs[0]) > -1
@@ -322,7 +322,7 @@ module.exports = exports = (argv) ->
322
322
  info.pages.push(pageDiv)
323
323
  res.render('static.html', info)
324
324
 
325
- app.get ///^\/([a-z0-9-]+)\.html$///, (req, res, next) ->
325
+ app.get ///^\/([a-z0-9-]+)\.html$///, cors, (req, res, next) ->
326
326
  slug = req.params[0]
327
327
  log(slug)
328
328
  if slug is 'runtests'
@@ -534,7 +534,7 @@ module.exports = exports = (argv) ->
534
534
  res.sendFile(sitemapLoc)
535
535
 
536
536
  xmlSitemapLoc = path.join(argv.status, 'sitemap.xml')
537
- app.get '/sitemap.xml', (req, res) ->
537
+ app.get '/sitemap.xml', cors, (req, res) ->
538
538
  fs.exists sitemapLoc, (exists) ->
539
539
  if exists
540
540
  res.sendFile(xmlSitemapLoc)
@@ -731,7 +731,7 @@ module.exports = exports = (argv) ->
731
731
  res.render('oops.html', {msg:'This is not your wiki!'})
732
732
 
733
733
  # Traditional request to / redirects to index :)
734
- app.get '/', (req, res) ->
734
+ app.get '/', cors, (req, res) ->
735
735
  home = path.join argv.assets, 'home', 'index.html'
736
736
  fs.stat home, (err, stats) ->
737
737
  if err || !stats.isFile()
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wiki-server",
3
3
  "description": "A Federated Wiki Server",
4
- "version": "0.25.4",
4
+ "version": "0.25.5",
5
5
  "author": {
6
6
  "name": "Ward Cunningham",
7
7
  "email": "ward@c2.com",