6174 / 6174/pagedown

Markdown.Sanitizer.js should not use global window variable

Aberta Para iniciantes
#43 0 comentários 0 reações 0 responsáveis Ver no GitHub
auto-migrated Priority-Medium Type-Defect
Linguagem predominante
JavaScript
Estrelas
0
Forks
0
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

```
We are trying to use Markdown.Sanitizer.js in Acre (a server-side javascript
environement).

However, we find ourselves hacking a window object to use Markdown.Sanitizer.js.

But if Markdown.Sanitizer.js passes "this" as the "window" variable, we can use
Markdown.Sanitizer.js on the server-side as is:

(function(window) {

...

})(this);

```

Original issue reported on code.google.com by `daep...@google.com` on 24 Sep 2012 at 2:59

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

Look at Markdown.Sanitizer.js in the repository to see how it currently references the global window variable. The change is to wrap the code in a function that takes 'this' as the window parameter, making it work in server-side environments like Acre. Test by checking if the script runs without a browser window object after the modification.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Stack de tecnologia
javascript
Domínio
tooling
Tipo de issue
Refatoração
Dificuldade
2/5
Tempo estimado
1-3 horas
Status de atividade
Estagnada
Clareza
Claramente especificada
Facilidade para iniciantes
65/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.