rudiedirkx/simpledom — Issue #4: Use `simple()` in structure
Author: rudiedirkx
Created: 2012-01-01 01:54:41+00:00
State: open

From no dependencies to 1 dependency: the function you need anyway. The structure will be much more readable then.

The following:

[
['p', ['Hi there, ', ['a', {href: '/blog-user/view/3', title: 'This is you!'}, ['YourNameHere']], '.']],
['p', ['Second paragraphs always suck...']]
]

would then become:

[
simple('p', [
'Hi there, ',
simple('a', {href: '/blog-user/view/3', title: 'This is you!'}, 'YourNameHere'),
'.'
]),
simple('p', 'Second paragraphs always suck...')
]

which would become:

Hi there, YourNameHere.

Second paragraphs always suck...

Can we make sure `simple('p', 'Text content')` is the same as `simple('p', ['Text content'])`?