我最近遇到了无法在内联TinyMCE可编辑区域添加空格的问题。
正如您所见,前三个导航项在单击时可编辑,您可以键入任何字符,但是当您选择“Thislinkcannotcontainspaces”链接时,您无法添加任何空格。
他们都使用相同的import tensorflow as tf
import numpy as np
import csv
import random
with open('wine_data.csv', 'rb') as csvfile:
input_arr = list(csv.reader(csvfile, delimiter=','))
for i in range(len(input_arr)):
input_arr[i][0] = int(input_arr[i][0]) - 1 # 0 index for one hot
for j in range(1, len(input_arr[i])):
input_arr[i][j] = float(input_arr[i][j])
random.shuffle(input_arr)
training_data = np.array(input_arr[:2*len(input_arr)/3]) # train on first two thirds of data
testing_data = np.array(input_arr[2*len(input_arr)/3:]) # test on last third of data
x_train = training_data[0:, 1:]
y_train = training_data[0:, 0]
x_test = testing_data[0:, 1:]
y_test = testing_data[0:, 0]
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)
return tf.Variable(initial)
def bias_variable(shape):
initial = tf.constant(0.1, shape=shape)
return tf.Variable(initial)
x = tf.placeholder(tf.float32, shape=[None, 13], name='x')
y_ = tf.placeholder(tf.float32, shape=[None], name='y_')
y_one_hot = tf.one_hot(tf.cast(y_, tf.int32), 3) # actual y values
W_fc1 = weight_variable([13, 128])
b_fc1 = bias_variable([128])
fc1 = tf.matmul(x, W_fc1)+b_fc1
W_fc2 = weight_variable([128, 3])
b_fc2 = bias_variable([3])
y = tf.nn.softmax(tf.matmul(fc1, W_fc2)+b_fc2)
cross_entropy = tf.reduce_sum(tf.nn.softmax_cross_entropy_with_logits(labels=y_one_hot, logits=y))
train_step = tf.train.GradientDescentOptimizer(1e-17).minimize(cross_entropy)
correct_prediction = tf.equal(tf.argmax(y,1), tf.argmax(y_one_hot,1))
accuracy = tf.reduce_mean(tf.cast(correct_prediction, tf.float32))
sess = tf.InteractiveSession()
tf.global_variables_initializer().run()
for _ in range(1000):
train_step.run(feed_dict={x: x_train, y_: y_train})
if _%10 == 0:
loss = cross_entropy.eval(feed_dict={x: x_train, y_: y_train})
print('step', _, 'loss', loss)
最小属性,它们都被data-editable
标记连接,都在a
内,我完全没有想到为什么会发生这种情况。
预期的行为是所有导航元素都可以使用包括空格在内的任何字符进行编辑。
li
tinymce.init({
selector: '[data-editable-minimal]',
inline: true,
toolbar: false,
menubar: false
});
h2.mce-content-body {
font-size: 200%;
padding: 0 25px 0 25px;
margin: 10px 0 10px 0;
}
body {
background: transparent;
}
.content {
overflow: visible;
position: relative;
width: auto;
margin-left: 0;
min-height: auto;
padding: inherit;
}
答案 0 :(得分:0)
根据TinyMCE文档,内联模式仅适用于块级元素。 <a>
标记不是块级元素,因此这不会令人感到意外。
https://www.tinymce.com/docs/configure/editor-appearance/#inline
<li>
标记是块级元素,因此如果您使用它,请改变结果吗?
答案 1 :(得分:0)
事实证明bootstrap
内存在冲突。当使用bootstrap
的下拉模块时,它会在下拉列表打开时覆盖某些键,从v3.3.7起,它会覆盖键代码38|40|27|32